Versions in this module Expand all Collapse all v0 v0.2.1 Aug 7, 2023 Changes in this version + var ErrDBHostNotSpecified = errors.New("--db-host must be specified") + var ErrDBNameNotSpecified = errors.New("--db-name must be specified") + var ErrDBPortNotSpecified = errors.New("--db-port must be specified") + var ErrDBUserNotSpecified = errors.New("--db-user must be specified") + type AppOptions struct + Database *DatabaseOptions + Generic *GenericOptions + Logging *LoggingOptions + Network *NetworkOptions + func NewAppOptions() *AppOptions + func (o *AppOptions) Complete(args []string) error + func (o *AppOptions) Config() *server.Config + func (o *AppOptions) Flags() (fss flag.NamedFlagSets) + func (o *AppOptions) LoadConfigFromFile(configFile string) error + func (o *AppOptions) Run() (err error) + func (o *AppOptions) Validate() (err error) + type DatabaseOptions struct + AutoMigrate bool + DBHost string + DBName string + DBPassword string + DBPort int + DBUser string + MigrateFile string + func NewDatabaseOptions() *DatabaseOptions + func (o *DatabaseOptions) AddFlags(fs *pflag.FlagSet) + func (o *DatabaseOptions) ApplyTo(config *server.Config) + func (o *DatabaseOptions) InstallDB() (*gorm.DB, error) + func (o *DatabaseOptions) Validate() error + func (o DatabaseOptions) MarshalJSON() ([]byte, error) + type GenericOptions struct + ConfigFile string + DumpEnvs bool + DumpVersion bool + func NewGenericOptions() *GenericOptions + func (o *GenericOptions) AddFlags(fs *pflag.FlagSet) + func (o *GenericOptions) ApplyTo(config *server.Config) + func (o *GenericOptions) Validate() error + type LoggingOptions struct + DisableText bool + DumpCurrentConfig bool + EnableLoggingToFile bool + JSONPretty bool + LogLevel string + LoggingDirectory string + ReportCaller bool + TextPretty bool + func NewLoggingOptions() *LoggingOptions + func (o *LoggingOptions) AddFlags(fs *pflag.FlagSet) + func (o *LoggingOptions) ApplyTo(config *server.Config) + func (o *LoggingOptions) InitLogging(projectName string) error + func (o *LoggingOptions) Validate() error + type NetworkOptions struct + CorsAllowedOriginList []string + Port int + RequestTimeout time.Duration + func NewNetworkOptions() *NetworkOptions + func (o *NetworkOptions) AddFlags(fs *pflag.FlagSet) + func (o *NetworkOptions) Validate() error