models

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 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"`
	LeaseID int64         `json:"lease_id,omitempty"`
	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)
	UpdateIP(ctx 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