refactor(server): Move server to package

This commit is contained in:
2025-08-10 22:13:42 +03:00
parent 4603668956
commit 68c98bb038
3 changed files with 80 additions and 65 deletions

22
pkg/args/args.go Normal file
View File

@@ -0,0 +1,22 @@
package args
import "git.ostiwe.com/ostiwe-com/status/version"
type ServerCmd struct {
Port string `arg:"-p,--port" help:"Port to listen on" default:"8080"`
}
type ServerDocumentationCmd struct {
Port string `arg:"-p,--port" help:"Port to listen on" default:"8081"`
Plain bool `arg:"--plain" help:"Enable plain text output" default:"true"`
PlainFormat string `arg:"--plain-format" help:"Set format for output (json, yaml)" default:"yaml"`
}
type AppArgs struct {
Server *ServerCmd `arg:"subcommand:server" help:"Start the api server"`
ServerDocumentation *ServerDocumentationCmd `arg:"subcommand:server-docs" help:"Generate documentation for api server"`
}
func (AppArgs) Version() string {
return version.AppVersion()
}