Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFromFile ¶
LoadConfigFromFile load json configuration file from configPath to given struct
Types ¶
type Config ¶
type Config struct { Name string `json:"name"` Version string `json:"version"` Description string `json:"description"` DB *DBConfig `json:"db"` HTTP *HTTPConfig `json:"http"` Upstream UpstreamConfig `json:"upstream"` }
Config all config container
type DBConfig ¶
type DBConfig struct {
Postgres map[string]*PostgresConfig `json:"postgres"`
}
DBConfig database config container
type HTTPConfig ¶
HTTPConfig http config
type HTTPUpstreamConfig ¶
type HTTPUpstreamConfig struct { Address string `json:"address"` Port string `json:"port"` Schema string `json:"schema"` }
HTTPUpstreamConfig http upstream config
func (*HTTPUpstreamConfig) GetURL ¶
func (hcfg *HTTPUpstreamConfig) GetURL() string
GetURL gets from http upstream connection string
type PostgresConfig ¶
type PostgresConfig struct { Database string `json:"database"` Host string `json:"host"` User string `json:"user"` Password string `json:"password"` SSLMode string `json:"sslmode"` }
PostgresConfig postgress config
func (*PostgresConfig) GetURL ¶
func (pCfg *PostgresConfig) GetURL() string
GetURL gets dssn connection string
type SocketConfig ¶
SocketConfig tcp / udp upstream config
func (*SocketConfig) GetTarget ¶
func (scfg *SocketConfig) GetTarget() string
GetTarget gets target address from upstream
type UnixSocketConfig ¶
type UnixSocketConfig struct {
FileDescriptor string `json:"fileDescriptor"`
}
UnixSocketConfig unix socket config
type UpstreamConfig ¶
type UpstreamConfig struct { HTTP map[string]*HTTPUpstreamConfig `json:"http"` UnixSocket map[string]UnixSocketConfig `json:"unixSocket"` Socket map[string]*SocketConfig `json:"socket"` }
UpstreamConfig container
Click to show internal directories.
Click to hide internal directories.