config

package
v0.0.0-...-0490640 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SERVICE_NAME = "config-mgmt-service"

Functions

This section is empty.

Types

type Service

type Service struct {
	Name     string `json:"name" mapstructure:"name"`
	Version  string `json:"version" mapstructure:"version"`
	Host     string `json:"host" mapstructure:"host"`
	Port     int    `json:"port" mapstructure:"port"`
	LogLevel string `json:"log_level" mapstructure:"log_level"`

	TLSConfig certs.TLSConfig `mapstructure:"tls"`
	// contains filtered or unexported fields
}

Service config definition

func ConfigFromViper

func ConfigFromViper() (*Service, error)

ConfigFromViper returns a Service instance from the current viper config

func Default

func Default() *Service

Default returns a blank Service instance with default parameters

func New

func New(b backend.Client) *Service

New returns a Service instance with default parameters and backend client

func (*Service) GetBackend

func (s *Service) GetBackend() backend.Client

Returns the configured backend

func (*Service) GetServiceCerts

func (s *Service) GetServiceCerts() *certs.ServiceCerts

func (*Service) ListenAddress

func (c *Service) ListenAddress() string

ListenAddress is the address where gRPC server will bind and listen

func (*Service) SetBackend

func (s *Service) SetBackend(b backend.Client)

func (*Service) SetLogLevel

func (c *Service) SetLogLevel()

SetLogLevel sets the log level for the service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL