- Apply automated linter fixes - Manually reformat fields in model/service.go - Resolve code complexity issues
40 lines
1.3 KiB
Go
40 lines
1.3 KiB
Go
package args
|
|
|
|
import "git.ostiwe.com/ostiwe-com/status/version"
|
|
|
|
type ServerCmd struct {
|
|
Port string `arg:"-p,--port,env:APP_PORT" default:"8080" help:"Port to listen on"`
|
|
}
|
|
|
|
type MigrationCreate struct {
|
|
Name string `arg:"-n,--name" help:"Name of migration"`
|
|
}
|
|
|
|
type Migration struct {
|
|
Create *MigrationCreate `arg:"subcommand:create" help:"Create migration"`
|
|
}
|
|
|
|
type ServerDocumentationCmd struct {
|
|
Port string `arg:"-p,--port,env:APP_PORT_DOCS" default:"8081" help:"Port to listen on"`
|
|
}
|
|
|
|
type GenerateDocumentationCmd struct {
|
|
Format string `arg:"--format,-f" default:"yaml" help:"Set output format (json, yaml)"`
|
|
Out string `arg:"--out,-o" default:"stdout" help:"Output file name (or stdout)"`
|
|
}
|
|
|
|
type DocsCmd struct {
|
|
Serve *ServerDocumentationCmd `arg:"subcommand:serve" help:"Generate and serve the documentation server"`
|
|
Generate *GenerateDocumentationCmd `arg:"subcommand:generate" help:"Generate documentation to file"`
|
|
}
|
|
|
|
type AppArgs struct {
|
|
Server *ServerCmd `arg:"subcommand:server" help:"Start the api server"`
|
|
Docs *DocsCmd `arg:"subcommand:docs" help:"Generate documentation to file or run documentation server"`
|
|
Migration *Migration `arg:"subcommand:migration" help:"Migration utils"`
|
|
}
|
|
|
|
func (AppArgs) Version() string {
|
|
return version.AppVersion()
|
|
}
|