Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Debug bool `env:"DEBUG"` AppDomain string `env:"APP_DOMAIN"` ServerHost string `env:"SERVER_HOST"` ServerPort int `env:"SERVER_PORT"` ServerReadTimeout int `env:"SERVER_READ_TIMEOUT"` ServerWriteTimeout int `env:"SERVER_WRITE_TIMEOUT"` ServerAllowOrigins []string `env:"SERVER_ALLOW_ORIGINS"` ServerAllowHeaders []string `env:"SERVER_ALLOW_HEADERS"` ServerAllowMethods []string `env:"SERVER_ALLOW_METHODS"` }
Config represents the config of application.
func Load ¶
func Load(opts *LoadOptions) (*Config, error)
Load will loads all variables from .env file & .env.{stage} file and the custom parameter store's variables to env process. After that, It will parse to a Config.
Stage must be expose to env process if application not runs in the local.
type LoadOptions ¶
type LoadOptions struct { Stage string AppName string CustomHandler ParameterStoreHandler }
LoadOptions is options for function load.
func (*LoadOptions) Validate ¶
func (o *LoadOptions) Validate() error
type ParameterStoreHandler ¶
ParameterStoreHandler is used to get parameter from another service and must be expose all parameters to the env.
Click to show internal directories.
Click to hide internal directories.