Documentation
¶
Index ¶
- func DecodeConfig(data []byte, cfg interface{}) error
- func DecodeConfigFile(path string, cfg interface{}) error
- func RunForConfig(ctx context.Context, cfg Config, init func(*InitData) error) error
- func RunForPath(ctx context.Context, path string, cfg Config, init func(*InitData) error) error
- func Signals(ctx context.Context, signals ...os.Signal) context.Context
- type ClientConfig
- type Config
- type ConfigStruct
- type InitData
- type TestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeConfig ¶
DecodeConfig loads config from yaml bytes
func DecodeConfigFile ¶
DecodeConfigFile loads config from yaml file
func RunForConfig ¶
RunForConfig starts the server for already set config
func RunForPath ¶
RunForPath starts the server, loading config from given path
Types ¶
type ClientConfig ¶
type ClientConfig struct {
Address string `yaml:"address"`
Insecure bool `yaml:"insecure"`
Secret string `yaml:"secret"`
}
func (*ClientConfig) Dial ¶
func (cfg *ClientConfig) Dial(opts ...grpc.DialOption) (*grpc.ClientConn, error)
type ConfigStruct ¶
type ConfigStruct struct {
Network string `yaml:"network"`
Address string `yaml:"address"`
LoggerEnabled bool `yaml:"logger-enabled"`
Secret string `yaml:"secret"`
SecretWhitelist []string `yaml:"secret-whitelist"`
}
func (*ConfigStruct) GetAddress ¶
func (cfg *ConfigStruct) GetAddress() string
func (*ConfigStruct) GetNetwork ¶
func (cfg *ConfigStruct) GetNetwork() string
func (*ConfigStruct) GetSecret ¶
func (cfg *ConfigStruct) GetSecret() string
func (*ConfigStruct) GetSecretWhitelist ¶
func (cfg *ConfigStruct) GetSecretWhitelist() []string
func (*ConfigStruct) IsLoggerEnabled ¶
func (cfg *ConfigStruct) IsLoggerEnabled() bool
type TestServer ¶
type TestServer struct {
// contains filtered or unexported fields
}
func StartTestServer ¶
func StartTestServer(ctx context.Context, init func(d *InitData) error) *TestServer
func (*TestServer) GetDialer ¶
func (s *TestServer) GetDialer() *ClientConfig
func (*TestServer) Stop ¶
func (s *TestServer) Stop() error
Click to show internal directories.
Click to hide internal directories.