Documentation ¶
Index ¶
- Variables
- func Configure(configurations ...string)
- func ConfigureLogger() (*zap.Logger, error)
- func SetConfig(config *Configuration)
- func SetDefaults()
- type ApplicationConfiguration
- type CORSConfiguration
- type Configuration
- type DatabaseConfiguration
- type LoggerConfiguration
- type ProfilerConfiguration
- type ServerConfiguration
Constants ¶
This section is empty.
Variables ¶
var ( // Executable is the name of the exec Executable = "fluoride" // Version is the current version Version = "1.0.0" )
var ( // Stop is the global stop instance Stop = &stop{ channel: make(chan struct{}), } )
Functions ¶
func Configure ¶
func Configure(configurations ...string)
Configure loads the configuration file into the config structs
func ConfigureLogger ¶
ConfigureLogger initializes and returns the configured logger
Types ¶
type ApplicationConfiguration ¶
type ApplicationConfiguration struct { Name string `json:"name" yaml:"name" mapstructure:"name"` Author string `json:"author" yaml:"author" mapstructure:"author"` Version string `json:"version" yaml:"version" mapstructure:"version"` }
ApplicationConfiguration is the application config model
func (*ApplicationConfiguration) IsEmpty ¶
func (config *ApplicationConfiguration) IsEmpty() bool
IsEmpty checks whether the struct is empty / uninitialized / nil
func (*ApplicationConfiguration) String ¶
func (config *ApplicationConfiguration) String() string
type CORSConfiguration ¶
type CORSConfiguration struct { AllowedOrigins []string `json:"allowed_origins" yaml:"allowed_origins" mapstructure:"allowed_origins"` AllowedMethods []string `json:"allowed_methods" yaml:"allowed_methods" mapstructure:"allowed_methods"` AllowedHeaders []string `json:"allowed_headers" yaml:"allowed_headers" mapstructure:"allowed_headers"` AllowedCredentials bool `json:"allowed_credentials" yaml:"allowed_credentials" mapstructure:"allowed_credentials"` MaxAge int `json:"max_age" yaml:"max_age" mapstructure:"max_age"` }
CORSConfiguration is the model for the CORS config
func (*CORSConfiguration) String ¶
func (config *CORSConfiguration) String() string
type Configuration ¶
type Configuration struct { Application ApplicationConfiguration `json:"application" yaml:"application" mapstructure:"application"` Profiler ProfilerConfiguration `json:"profiler" yaml:"profiler" mapstructure:"profiler"` Logger LoggerConfiguration `json:"logger" yaml:"logger" mapstructure:"logger"` Server ServerConfiguration `json:"server" yaml:"server" mapstructure:"server"` Database DatabaseConfiguration `json:"database" yaml:"database" mapstructure:"database"` }
Configuration is the primary configuration model
func (*Configuration) IsEmpty ¶
func (config *Configuration) IsEmpty() bool
IsEmpty checks whether the struct is empty / uninitialized / nil
func (*Configuration) String ¶
func (config *Configuration) String() string
type DatabaseConfiguration ¶
type DatabaseConfiguration struct { SleepBetweenRetries string `json:"sleep_between_retries" yaml:"sleep_between_retries" mapstructure:"sleep_between_retries"` MaxConnections int `json:"max_connections" yaml:"max_connections" mapstructure:"max_connections"` Username string `json:"username" yaml:"username" mapstructure:"username"` Password string `json:"password" yaml:"password" mapstructure:"password"` Database string `json:"database" yaml:"database" mapstructure:"database"` Retries int `json:"retries" yaml:"retries" mapstructure:"retries"` Type string `json:"type" yaml:"type" mapstructure:"type"` Host string `json:"host" yaml:"host" mapstructure:"host"` Port string `json:"port" yaml:"port" mapstructure:"port"` SSL string `json:"ssl" yaml:"ssl" mapstructure:"ssl"` }
DatabaseConfiguration is the database config model
func (*DatabaseConfiguration) IsEmpty ¶
func (config *DatabaseConfiguration) IsEmpty() bool
IsEmpty checks whether the struct is empty / uninitialized / nil
func (*DatabaseConfiguration) String ¶
func (config *DatabaseConfiguration) String() string
type LoggerConfiguration ¶
type LoggerConfiguration struct { Level string `json:"level" yaml:"level" mapstructure:"level"` Encoding string `json:"encoding" yaml:"encoding" mapstructure:"encoding"` Color bool `json:"color" yaml:"color" mapstructure:"color"` DevMode bool `json:"dev_mode" yaml:"dev_mode" mapstructure:"dev_mode"` DisableCaller bool `json:"disable_caller" yaml:"disable_caller" mapstructure:"disable_caller"` DisableStacktrace bool `json:"disable_stacktrace" yaml:"disable_stacktrace" mapstructure:"disable_stacktrace"` }
LoggerConfiguration is the logger config model
func (*LoggerConfiguration) IsEmpty ¶
func (config *LoggerConfiguration) IsEmpty() bool
IsEmpty checks whether the struct is empty / uninitialized / nil
func (*LoggerConfiguration) String ¶
func (config *LoggerConfiguration) String() string
type ProfilerConfiguration ¶
type ProfilerConfiguration struct { Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"` Host string `json:"host" yaml:"host" mapstructure:"host"` Port string `json:"port" yaml:"port" mapstructure:"port"` }
ProfilerConfiguration is the profiler config model
func (*ProfilerConfiguration) String ¶
func (config *ProfilerConfiguration) String() string
type ServerConfiguration ¶
type ServerConfiguration struct { Network string `json:"network" yaml:"network" mapstructure:"network"` Host string `json:"host" yaml:"host" mapstructure:"host"` Port string `json:"port" yaml:"port" mapstructure:"port"` LogRequests bool `json:"log_requests" yaml:"log_requests" mapstructure:"log_requests"` LogRequestsBody bool `json:"log_requests_body" yaml:"log_requests_body" mapstructure:"log_requests_body"` LogDisabledHTTP []string `json:"log_disabled_http" yaml:"log_disabled_http" mapstructure:"log_disabled_http"` ProfilerEnabled bool `json:"profiler_enabled" yaml:"profiler_enabled" mapstructure:"profiler_enabled"` ProfilerPath string `json:"profiler_path" yaml:"profiler_path" mapstructure:"profiler_path"` CORS CORSConfiguration `json:"cors" yaml:"cors" mapstructure:"cors"` }
ServerConfiguration is the server config model
func (*ServerConfiguration) IsEmpty ¶
func (config *ServerConfiguration) IsEmpty() bool
IsEmpty checks whether the struct is empty / uninitialized / nil
func (*ServerConfiguration) String ¶
func (config *ServerConfiguration) String() string