Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseConf ¶
type DatabaseConf struct { Type string `env:"TYPE" yaml:"type,omitempty"` Driver string `env:"DRIVER" yaml:"driver,omitempty"` Database string `env:"DATABASE" yaml:"database,omitempty"` Username string `env:"USERNAME" yaml:"username,omitempty"` Password string `env:"PASSWORD" yaml:"password,omitempty"` Host string `env:"HOST" yaml:"host,omitempty"` Port int `env:"PORT" yaml:"port,omitempty"` Schema string `env:"SCHEMA" yaml:"schema,omitempty"` CreateSchema bool `env:"CREATE_SCHEMA" yaml:"create_schema,omitempty"` DSN string `env:"DSN" yaml:"dsn,omitempty"` GORM GORMConf `envPrefix:"GORM_" yaml:"gorm,omitempty"` DriverOptions DatabaseDriverOptions `envPrefix:"DRIVER_" yaml:"driver_options,omitempty"` Attributes map[string]string `envPrefix:"ATTR_" yaml:"attributes,omitempty"` // ConnectionAttributes }
func (*DatabaseConf) BuildDSN ¶
func (conf *DatabaseConf) BuildDSN() string
type DatabaseDriverOptions ¶
type DatabaseDriverOptions struct { MaxIdleConnections int `env:"MAX_IDLE_CONNS" yaml:"max_idle_connections,omitempty"` MaxOpenConnections int `env:"MAX_OPEN_CONNS" yaml:"max_open_connections,omitempty"` ConnMaxIdleTime time.Duration `env:"MAX_IDLE_TIME" yaml:"conn_max_idle_time,omitempty"` ConnMaxLifetime *time.Duration `env:"MAX_LIVE_TIME" yaml:"conn_max_lifetime,omitempty"` }
type DebugConf ¶
type DebugConf struct { ListenConf `yaml:",inline"` Enabled bool `env:"ENABLED" envDefault:"true" yaml:"enabled,omitempty"` }
type DirConf ¶
type DirConf struct { Name string `yaml:"name,omitempty"` // application name RootDir string `env:"ROOT_DIR" yaml:"root_dir,omitempty"` DataDir string `env:"DATA_DIR" yaml:"data_dir,omitempty"` CacheDir string `env:"CACHE_DIR" yaml:"cache_dir,omitempty"` ConfigDir string `env:"CONFIG_DIR" yaml:"config_dir,omitempty"` }
func (*DirConf) InitDirConf ¶
type GORMConf ¶
type GORMConf struct { DisableForeignKeyConstraintWhenMigrating bool `yaml:"disable_foreign_key_constraint_when_migrating,omitempty"` Log SQLLogConf `envPrefix:"LOG_" yaml:"log,omitempty"` }
type GRPCConf ¶
type GRPCConf struct { ListenConf `yaml:",inline"` Enabled bool `env:"ENABLED" envDefault:"true" yaml:"enabled,omitempty"` Gateway GRPCGatewayConf `envPrefix:"GATEWAY_" yaml:"gateway,omitempty"` }
type GRPCGatewayConf ¶
type GRPCGatewayConf struct { ListenConf `yaml:",inline"` Enabled bool `env:"ENABLED" envDefault:"true" yaml:"enabled,omitempty"` Prefix string `env:"PREFIX" yaml:"prefix,omitempty"` }
type HTTPConf ¶
type HTTPConf struct {
ListenConf `yaml:",inline"`
}
type ListenConf ¶
type ListenConf struct { Addr string `env:"ADDR" yaml:"addr,omitempty"` Port int `env:"PORT" yaml:"port,omitempty"` }
func (ListenConf) GetAddr ¶
func (c ListenConf) GetAddr() string
func (ListenConf) Serve ¶
func (c ListenConf) Serve(ss ServeService) error
type LogConf ¶
type LogConf struct {
Level string `env:"LEVEL" envDefault:"info" yaml:"level,omitempty"`
}
type RedisConf ¶
type RedisConf struct { DSN string `env:"DSN" yaml:"dsn,omitempty"` Address string `env:"ADDRESS" yaml:"address,omitempty"` Username string `env:"USERNAME" yaml:"username,omitempty"` Password string `env:"PASSWORD" yaml:"password,omitempty"` Database int `env:"DATABASE" yaml:"database,omitempty"` DialTimeout time.Duration `env:"DIAL_TIMEOUT" yaml:"dial_timeout,omitempty"` ReadTimeout time.Duration `env:"READ_TIMEOUT" yaml:"read_timeout,omitempty"` WriteTimeout time.Duration `env:"WRITE_TIMEOUT" yaml:"write_timeout,omitempty"` Attributes map[string]string `envPrefix:"ATTR_" yaml:"attributes,omitempty"` }
type SQLLogConf ¶
type ServeService ¶
Click to show internal directories.
Click to hide internal directories.