config

package
v0.0.0-...-e1c0fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2018 License: MIT Imports: 12 Imported by: 11

Documentation

Index

Constants

View Source
const (
	BackoffDelay         = 5 * time.Second
	MaxMsgSize           = 1 << 11 // 2048
	ClientRequestTimeout = 15 * time.Second
	ServerRequestTimeout = 5 * time.Second
)

List of gRCP configuration values.

Variables

This section is empty.

Functions

func PrintJSONConfig

func PrintJSONConfig() error

PrintJSONConfig prints the services configuration in JSON format.

Types

type Config

type Config struct {
	ConfigFile string `toml:"-"`
	// List of services
	Alfa  Service `toml:"alfa"`
	Beta  Service `toml:"beta"`
	Omega Service `toml:"omega"`
}

Config represents the global micro-service configuration.

func GetConfig

func GetConfig() (Config, error)

GetConfig returns a Config struct representing a TOML file.

type Database

type Database struct {
	Server  string
	Ports   []int
	ConnMax int `toml:"connection_max"`
}

Database represents a database struct.

type Server

type Server struct {
	Host          string
	Port          int
	Address       string
	Clients       []string `json:",omitempty"`
	MicroServices []string `toml:"micro_services" json:",omitempty"`
	IsGateway     bool     `toml:"is_gateway" json:",omitempty"`
	GatewayPort   int      `toml:"gateway_port" json:",omitempty"`
}

Server represents a server configuration struct.

type Service

type Service struct {
	Name      string
	ShortName string   `toml:"short_name" json:",omitempty"`
	Database  Database `toml:"database"`
	Server    Server
}

Service represents a micro-service struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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