Documentation ¶
Index ¶
- type EnvConfig
- func (cfg *EnvConfig) GrpcHostEnvName() string
- func (cfg *EnvConfig) GrpcPortEnvName() string
- func (cfg *EnvConfig) PGDatabaseEnvName() string
- func (cfg *EnvConfig) PGHostEnvName() string
- func (cfg *EnvConfig) PGPasswordEnvName() string
- func (cfg *EnvConfig) PGPortEnvName() string
- func (cfg *EnvConfig) PGSSLModeEnvName() string
- func (cfg *EnvConfig) PGUserEnvName() string
- type EnvConfiger
- type EnvFile
- type Grpc
- type GrpcConfiger
- type GrpcEnvConfiger
- type PgConfiger
- type PgEnvConfiger
- type Postgres
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvConfig ¶
EnvConfig is a struct that holds all the configuration for the server
func (*EnvConfig) GrpcHostEnvName ¶
GrpcHostEnvName returns the GRPC host environment name
func (*EnvConfig) GrpcPortEnvName ¶
GrpcPortEnvName returns the GRPC port environment name
func (*EnvConfig) PGDatabaseEnvName ¶
PGDatabaseEnvName returns the Postgres database environment name
func (*EnvConfig) PGHostEnvName ¶
PGHostEnvName returns the Postgres host environment name
func (*EnvConfig) PGPasswordEnvName ¶
PGPasswordEnvName returns the Postgres password environment name
func (*EnvConfig) PGPortEnvName ¶
PGPortEnvName returns the Postgres port environment name
func (*EnvConfig) PGSSLModeEnvName ¶
PGSSLModeEnvName returns the Postgres sslmode environment name
func (*EnvConfig) PGUserEnvName ¶
PGUserEnvName returns the Postgres user environment name
type EnvConfiger ¶
type EnvConfiger interface { GrpcEnvConfiger PgEnvConfiger }
EnvConfiger interface for config environment
func NewEnvConfig ¶
func NewEnvConfig() (EnvConfiger, error)
NewEnvConfig returns a new EnvConfig struct
type EnvFile ¶
type EnvFile struct {
Path string `yaml:"path" env-default:"./.env"`
}
EnvFile is a struct that holds all the configuration for the env file
type Grpc ¶
type Grpc struct { Host string `yaml:"host" env-default:"GRPC_HOST"` Port string `yaml:"port" env-default:"GRPC_PORT"` }
Grpc is a struct that holds all the configuration for the GRPC server
type GrpcConfiger ¶
type GrpcConfiger interface {
Address() string
}
GrpcConfiger interface for grpc config
func NewGrpcConfig ¶
func NewGrpcConfig(env EnvConfiger) (GrpcConfiger, error)
NewGrpcConfig returns a new instance of GrpcConfiger
type GrpcEnvConfiger ¶
GrpcEnvConfiger interface for config GRPC environment
type PgConfiger ¶
type PgConfiger interface {
DSN() string
}
PgConfiger interface for config Postgres
func NewPGConfig ¶
func NewPGConfig(env EnvConfiger) (PgConfiger, error)
NewPGConfig is a function that returns a new instance of the PgConfiger interface
type PgEnvConfiger ¶
type PgEnvConfiger interface { PGHostEnvName() string PGPortEnvName() string PGUserEnvName() string PGPasswordEnvName() string PGDatabaseEnvName() string PGSSLModeEnvName() string }
PgEnvConfiger interface for config Postgres environment
type Postgres ¶
type Postgres struct { Host string `yaml:"host" env-default:"PG_HOST"` Port string `yaml:"port" env-default:"PG_PORT"` User string `yaml:"user" env-default:"PG_USER"` Password string `yaml:"pass" env-default:"PG_PASSWORD"` Database string `yaml:"database" env-default:"PG_DATABASE"` SslMode string `yaml:"sslmode" env-default:"PG_SSLMODE"` }
Postgres is a struct that holds all the configuration for the postgres