Releases: yoyofx/yoyogo
Releases · yoyofx/yoyogo
v1.8.7 Integrated swagger support
- 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
v1.8.5
v1.8.4 fix vulnerability CVE-2022-27664
Repair vulnerability of CVE-***
v1.8.3 Repair vulnerability of CVE-***
v1.8.2 fixed bugs for yaml
Fixed Unhandled exception in gopkg.in/yaml.v3
v1.8.1
Features
- 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
go runtime upgrade 1.18
1.action parameters mapping functions
2.action parameters mapping functions v2
3.mixed bindings.
4.添加本地配置对象
5.优化dockerfile
v1.7.11 print error stack by console
Fixed bugs:
- print all stack traces for console