models

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETCD_LINK_DIRECTORY = "/link"
)

Variables

View Source
var (
	ErrIPAlreadyPresent = errors.New("IP already present")
)

Functions

func NewEtcdStorage

func NewEtcdStorage(config config.Config) etcdStorage

Types

type Healthcheck

type Healthcheck struct {
	Type HealthcheckType `json:"type"`
	Host string          `json:"host"`
	Port int             `json:"port"`
}

func (Healthcheck) Addr

func (h Healthcheck) Addr() string

type HealthcheckType

type HealthcheckType string
const (
	TCPHealthCheck HealthcheckType = "TCP"
)

type IP

type IP struct {
	ID     string        `json:"id"`
	IP     string        `json:"ip"`
	Status string        `json:"status,omitempty"`
	Checks []Healthcheck `json:"checks,omitempty"`
}

type Storage

type Storage interface {
	GetIPs(context.Context) ([]IP, error)
	AddIP(context.Context, IP) (IP, error)
	RemoveIP(context.Context, string) error
}

Directories

Path Synopsis
Package modelsmock is a generated GoMock package.
Package modelsmock is a generated GoMock package.

Jump to

Keyboard shortcuts

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