config

package
v0.0.0-...-c27dcde Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxConnections      uint32            `json:"max_connections"`
	ClientTimeout       string            `json:"client_timeout"`
	ConnectionTimeout   string            `json:"connection_timeout"`
	Balancer            string            `json:"balancer"`
	Protocol            string            `json:"protocol"`
	Port                uint32            `json:"port"`
	Scheme              string            `json:"scheme"`
	ProxyHeaders        map[string]string `json:"proxy_headers"`
	Servers             []Server          `json:"servers"`
	FailedRequestsLimit uint32            `json:"failed_requests_limit"`
	ServerScheme        string            `json:"server_scheme"`
	CertFilePath        string            `json:"cert_file_path"`
	KeyFilePath         string            `json:"key_file_path"`
	Discovery           string            `json:"discovery"`
}

Config provides definition of the config

func MakeDefaultConfig

func MakeDefaultConfig() *Config

MakeDefaultConfig provides loading of default conig

func ReadConfig

func ReadConfig(path string) (*Config, error)

ReadConfig provides redaing of the config

func ReadConsulConfig

func ReadConsulConfig(key string) (*Config, error)

ReadConsulConfig provides reading of config from Comsul

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

Marshal provides servialization of the Config struct

type Server

type Server struct {
	Host string `json:"host"`
	Port uint32 `json:"port"`
}

Server defines config for the server

Jump to

Keyboard shortcuts

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