config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfFile

type ConfFile struct {
	Services NodesMap `yaml:"services"`
	NoNode   struct {
		Message string `yaml:"message"`
	} `yaml:"no_node"`
}

ConfFile map by svc for node:conf

func NewConf

func NewConf(reader io.Reader) *ConfFile

NewConf makes new config for yml reader

func (ConfFile) Get

func (c ConfFile) Get() NodesMap

Get map svc:[nodes] and set default method to HEAD (if not defined)

type Node

type Node struct {
	Server string `yaml:"server"`
	Ping   string `yaml:"ping"`
	Weight int    `yaml:"weight"`
	Method string `yaml:"method"`
}

Node has a part from config and alive + changed for status monitoring

func (Node) String

func (n Node) String() string

type NodesMap

type NodesMap map[string][]Node

NodesMap wraps map with svc name as a key and all svc nodes as value

Jump to

Keyboard shortcuts

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