Skip to content

Releases: yoyofx/yoyogo

v1.8.7 Integrated swagger support

07 Feb 09:15
6924b33
Compare
Choose a tag to compare
  • Integrated swagger support

Used Swagger UI

// IRouteBuilder app.UseEndpoints(...)
endpoints.UseSwaggerDoc(rb,
		swagger.Info{
			Title:          "YoyoGO 框架文档演示",
			Version:        "v1.0.0",
			Description:    "框架文档演示swagger文档 v1.0 [ #yoyogo](https://github.com/yoyofx/yoyogo).",
			TermsOfService: "https://dev.yoyogo.run",
			Contact: swagger.Contact{
				Email: "zl.hxd@hotmail.com",
				Name:  "yoyogo",
			},
			License: swagger.License{
				Name: "MIT",
				Url:  "https://opensource.org/licenses/MIT",
			},
		},
		func(openapi *swagger.OpenApi) {
			openapi.AddSecurityBearerAuth()
		})

// mvc controller
```golang

// DocumentResponse custom document response
type DocumentResponse struct {
	Message string        `json:"message" doc:"消息"`
	List    []DocumentDto `json:"list" doc:"文档列表"`
	Success bool          `json:"success" doc:"是否成功"`
}

func (controller UserController) GetDocumentList(request *struct {
	mvc.RequestGET `route:"/v1/user/doc/list" doc:"获取全部文档列表"`
}) DocumentResponse {

	return DocumentResponse{Message: "GetDocumentList", List: []DocumentDto{
		{Id: 1, Name: "test1", Time: time.Now()}, {Id: 2, Name: "test2", Time: time.Now()},
		{Id: 3, Name: "test3", Time: time.Now()}, {Id: 4, Name: "test4", Time: time.Now()},
		{Id: 5, Name: "test5", Time: time.Now()}, {Id: 6, Name: "test6", Time: time.Now()},
	}, Success: true}
}

v1.8.6

14 Dec 06:22
b06cc29
Compare
Choose a tag to compare
  1. fixed bug for httpclient add header.
  2. update grpc / viper and others dependencies version .

v1.8.5

06 May 03:19
105aca6
Compare
Choose a tag to compare
  • update golang.org/x/image to 0.5.0
  • update prometheus/client_golang to v1.15.1

v1.8.4 fix vulnerability CVE-2022-27664

23 Sep 10:02
f30952a
Compare
Choose a tag to compare

v1.8.3 Repair vulnerability of CVE-***

02 Aug 08:08
01b3cc9
Compare
Choose a tag to compare

v1.8.2 fixed bugs for yaml

31 May 02:56
df28728
Compare
Choose a tag to compare

Fixed Unhandled exception in gopkg.in/yaml.v3

v1.8.1

25 Apr 06:25
4485272
Compare
Choose a tag to compare

Features

  1. Get config value for DSL, that support key or ref object.

Such as YAML:

env: ${CUSTOM_ENV}
profile:
  dns: ${REMOTE_HOST}
  ip: ${REMOTE_IP:10.0.1.12}
  namespace: ${MYNAMESPACE:space.localhost}

Go Example

type Profile struct {
	DNS string `config:"dns"`
	IP  string `config:"ip"`
	NS  string `config:"namespace"`
}

config := abstractions.NewConfigurationBuilder().
       AddEnvironment().
       AddYamlFile("config").Build()

config.GetConfigObject("profile", &profile)
assert.Equal(t, profile.NS, "space.yoyogo.run")
assert.Equal(t, profile.DNS, "my host")
assert.Equal(t, profile.IP, "10.0.1.12")

or

env := config.Get("env")
dns := config.Get("profile.dns")
ip := config.Get("profile.ip")

assert.Equal(t, env, "my env variable")
assert.Equal(t, dns, "my host")
assert.Equal(t, ip, "10.0.1.12")

v1.8.0

20 Apr 03:50
3bc500e
Compare
Choose a tag to compare

v1.7.11 print error stack by console

10 Nov 03:12
5d15243
Compare
Choose a tag to compare

Fixed bugs:

  • print all stack traces for console

v1.7.10

10 Oct 15:04
b2a1398
Compare
Choose a tag to compare