Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrConfigMissingParameter raised when one of the required config parameters are missing ErrConfigMissingParameter = errors.New("missing required configuration parameter") )
Functions ¶
func NewYamlConfig ¶
NewYamlConfig loads the conf.yaml file and return the new config
Types ¶
type AuthTokenSection ¶
type AuthTokenSection struct { Enabled bool `yaml:"enabled"` Token string `yaml:"token"` Header string `yaml:"header"` Path string `yaml:"path"` }
AuthTokenSection for simple authorization token
type JWTTokenSection ¶
type JWTTokenSection struct { Enabled bool `yaml:"enabled"` SecretKey string `yaml:"secret_key"` CookieName string `yaml:"cookie_name"` }
JWTTokenSection for JWT token authorization middleware
type YamlConfig ¶
type YamlConfig struct { Version string `yaml:"version"` // Version of the server Port int `yaml:"port"` // Server port Swagger bool `yaml:"swagger"` // Swagger on/off Title string `yaml:"title"` // Service title Description string `yaml:"description"` // Service description Mode string `yaml:"mode"` // debug/release AuthToken AuthTokenSection `yaml:"auth_token"` JWTToken JWTTokenSection `yaml:"jwt_token"` }
YamlConfig exports crucial microservice settings
func (*YamlConfig) LoadConfig ¶
func (c *YamlConfig) LoadConfig(pathToConfig string, config interface{}) error
LoadConfig reads local config.yaml file
Click to show internal directories.
Click to hide internal directories.