Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(cfg interface{}) error
LoadConfig loads configuration from provided file and serializes it into RpConfig struct
Types ¶
type ConsulConfig ¶
type ConsulConfig struct { Address string `env:"RP_CONSUL_ADDRESS" envDefault:"registry:8500"` Scheme string `env:"RP_CONSUL_SCHEME" envDefault:"http"` Token string `env:"RP_CONSUL_TOKEN"` PollInterval int `env:"RP_CONSUL_POLL_INTERVAL" envDefault:"5"` Tags []string `env:"RP_CONSUL_TAGS"` }
ConsulConfig represents Consul Discovery service configuration
func (*ConsulConfig) AddTags ¶
func (c *ConsulConfig) AddTags(tags ...string)
AddTags parses tags to string array. Extremely slow implementation - simplicity over speed
type Registry ¶
type Registry string
Registry represents type of used service discovery server
const ( //Consul service discovery Consul Registry = "consul" )
type RpConfig ¶
type RpConfig struct { AppName string `env:"RP_APP_NAME" envDefault:"goRP"` Registry Registry `env:"RP_REGISTRY" envDefault:"consul"` Server *ServerConfig Consul *ConsulConfig }
RpConfig represents Composite of all app configs
type ServerConfig ¶
type ServerConfig struct { Hostname string `env:"HOSTNAME" envDefault:"localhost"` Port int `env:"RP_SERVER_PORT" envDefault:"8080"` }
ServerConfig represents Main service configuration
Click to show internal directories.
Click to hide internal directories.