Documentation ¶
Index ¶
- func AuthConfig(globalConfig *viper.Viper) *viper.Viper
- func DBConfig(globalConfig *viper.Viper) (config *mysql.Config, err error)
- func DomainsConfig(globalConfig *viper.Viper) (config []domain.ConfigItem, err error)
- func LoadConfig() *viper.Viper
- func LoggingConfig(globalConfig *viper.Viper) *viper.Viper
- func ServerConfig(globalConfig *viper.Viper) *viper.Viper
- func TokenConfig(globalConfig *viper.Viper) (*token.Config, error)
- type Application
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthConfig ¶
AuthConfig returns an auth dynamic config from the global config (env var changes impacts values)
func DomainsConfig ¶
func DomainsConfig(globalConfig *viper.Viper) (config []domain.ConfigItem, err error)
DomainsConfig returns the domains fixed config from the global config Panic in case of marshaling error.
func LoadConfig ¶
LoadConfig loads and return the global configuration from files, flags, env, ... The precedence of config values in viper is the following: 1) explicit call to Set 2) flag (i.e., settable by command line) 3) env 4) config file 5) key/value store 6) default
func LoggingConfig ¶
LoggingConfig returns a logging dynamic config from the global config (env var changes impacts values)
func ServerConfig ¶
ServerConfig returns a logging dynamic config from the global config (env var changes impacts values)
Types ¶
type Application ¶
type Application struct { HTTPHandler *chi.Mux Config *viper.Viper Database *database.DB // contains filtered or unexported fields }
Application is the core state of the app
func (*Application) CheckConfig ¶
func (app *Application) CheckConfig() error
CheckConfig checks that the database contains all the data needed by the config
func (*Application) CreateMissingData ¶
func (app *Application) CreateMissingData() error
CreateMissingData fills the database with required data (if missing)
func (*Application) ReplaceAuthConfig ¶
func (app *Application) ReplaceAuthConfig(newGlobalConfig *viper.Viper)
ReplaceAuthConfig replaces the auth part of the config by the given one.
func (*Application) ReplaceDomainsConfig ¶
func (app *Application) ReplaceDomainsConfig(newGlobalConfig *viper.Viper)
ReplaceDomainsConfig replaces the domains part of the config by the given one.
Directories ¶
Path | Synopsis |
---|---|
answers
Package answers provides API services for task answers managing
|
Package answers provides API services for task answers managing |
auth
Package auth provides API services related to authentication
|
Package auth provides API services related to authentication |
contests
Package contests provides API services for contests managing
|
Package contests provides API services for contests managing |
items
Package items provides API services for items managing
|
Package items provides API services for items managing |
AlgoreaBackend API.
|
AlgoreaBackend API. |