Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/infraboard/mcube
Browse files Browse the repository at this point in the history
  • Loading branch information
yumaojun03 committed Nov 21, 2023
2 parents 074ed44 + c4fe6e7 commit 78716cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ioc/config/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (a *Application) SwagerDocs(swo *spec.Swagger) {

func (a *Application) Start(ctx context.Context) error {
a.log.Info().Msgf("loaded configs: %s", ioc.Config().List())
a.log.Info().Msgf("loaded controllers: %s", ioc.Config().List())
a.log.Info().Msgf("loaded controllers: %s", ioc.Controller().List())
a.log.Info().Msgf("loaded apis: %s", ioc.Api().List())

if *a.HTTP.Enable {
Expand Down
4 changes: 2 additions & 2 deletions ioc/config/application/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ type Grpc struct {
log *zerolog.Logger

// 启动后执行
PostStart func(context.Context) error
PostStart func(context.Context) error `json:"-" yaml:"-" toml:"-" env:"-"`
// 关闭前执行
PreStop func(context.Context) error
PreStop func(context.Context) error `json:"-" yaml:"-" toml:"-" env:"-"`
}

func (g *Grpc) setEnable(v bool) {
Expand Down
6 changes: 3 additions & 3 deletions ioc/config/application/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type Http struct {
maxHeaderBytes uint64
log *zerolog.Logger
server *http.Server
routerBuilders map[WEB_FRAMEWORK]RouterBuilder
routerBuilders map[WEB_FRAMEWORK]RouterBuilder `json:"-" yaml:"-" toml:"-" env:"-"`
RouterBuildConfig *BuildConfig
}

Expand All @@ -92,9 +92,9 @@ type BuildHook func(http.Handler)

type BuildConfig struct {
// 装载Ioc路由之前
BeforeLoad BuildHook
BeforeLoad BuildHook `json:"-" yaml:"-" toml:"-" env:"-"`
// 装载Ioc路由之后
AfterLoad BuildHook
AfterLoad BuildHook `json:"-" yaml:"-" toml:"-" env:"-"`
}

func (h *Http) setEnable(v bool) {
Expand Down
2 changes: 2 additions & 0 deletions ioc/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ func (i *NamespaceStore) LoadFromFile(filename string) error {
err = file.ReadYamlFile(filename, &cfg)
case ".json":
err = file.ReadJsonFile(filename, &cfg)
default:
err = fmt.Errorf("unspport format: %s", fileType)
}
if err != nil {
return err
Expand Down

0 comments on commit 78716cb

Please sign in to comment.