Documentation ¶
Overview ¶
Package config contains the configuration of the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Logging is the logging configuration. Logging struct { // LogLevel is the log level to use. Level string `envconfig:"LOG_LEVEL" default:"debug"` // LogFormat is the log format to use. Format string `envconfig:"LOG_FORMAT" default:"console"` } // Server is the http server configuration. Server struct { // GinMode is the mode to run the server in. GinMode string `envconfig:"GIN_MODE" default:"release"` // Port is the port to listen on. Port int `envconfig:"SERVER_PORT" default:"8080"` // Meddlewares is the configuration for the middlewares. Middlewares struct { // Ratelimiter is the configuration for the ratelimiter middleware. Ratelimiter struct { // Rate is the rate at which requests are allowed. Rate ratelimiter.Rate `envconfig:"RATELIMITER_RATE" default:"second"` // Limit is the maximum number of requests allowed. Limit uint `envconfig:"RATELIMITER_LIMIT" default:"5"` // Key is the key to use for the ratelimiter. Key ratelimiter.Key `envconfig:"RATELIMITER_KEY" default:"client_ip"` } // Proofer is the configuration for the proofer middleware. Proofer struct { // ChallengeDifficulty is the difficulty of the proof of work challenge. ChallengeDifficulty int `envconfig:"CHALLENGE_DIFFICULTY" default:"20"` // SaltLength is the length of the salt. SaltLength int `envconfig:"SALT_LENGTH" default:"8"` } } } }
Config is the main configuration of the application. It is populated from environment variables and defaults.
Click to show internal directories.
Click to hide internal directories.