12345678910111213141516171819202122232425262728293031 |
- package iam
- import (
- "gogs.tyduyong.com/duyong/dy-admin/internal/iam/config"
- "gogs.tyduyong.com/duyong/dy-pkg/app"
- "gogs.tyduyong.com/duyong/dy-pkg/logs"
- )
- const commandDesc = `iam(identity and access management) system command description`
- func NewApp(basename string) *app.App {
- opts := config.NewConfig()
- application := app.NewApp("iam server",
- basename,
- app.WithOptions(opts),
- app.WithDescription(commandDesc),
- app.WithDefaultValidArgs(),
- app.WithRunFunc(run(opts)),
- )
- return application
- }
- func run(opts *config.Config) app.RunFunc {
- return func(basename string) error {
- logs.Init(opts.LogOptions)
- defer logs.Flush()
- return Run(opts)
- }
- }
|