types

package
v0.0.0-...-22c38b1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2018 License: MIT Imports: 3 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NAT    = "nat"
	ROUTE  = "route"
	TUNNEL = "tunnel"
)
View Source
var (
	Protocols  = []string{"tcp", "udp"}
	Schedulers = []string{"rr", "wrr", "lc"}
)
View Source
var (
	ErrServiceNotFound     = ErrNotFound("service not found")
	ErrDestinationNotFound = ErrNotFound("destination not found")
	ErrCheckNotFound       = ErrNotFound("check not found")
	ErrServiceConflict     = ErrConflict("service already exists")
	ErrDestinationConflict = ErrConflict("destination already exists")
)

Functions

This section is empty.

Types

type CheckSpec

type CheckSpec struct {
	ServiceID string
	Type      string

	HttpPath string
	Script   string
	Shell    string

	Interval time.Duration
	Timeout  time.Duration
}

type Destination

type Destination struct {
	Name      string `validate:"required"`
	Address   string `validate:"required"`
	Port      uint16 `validate:"gte=1,lte=47808,required"`
	Weight    int32
	Mode      string `validate:"required"`
	ServiceId string `validate:"required"`
}

func (Destination) Equal

func (d Destination) Equal(dst Destination) bool

func (Destination) GetId

func (dst Destination) GetId() string

func (Destination) IpvsId

func (dst Destination) IpvsId() string

type DestinationList

type DestinationList []Destination

func (DestinationList) Len

func (l DestinationList) Len() int

func (DestinationList) Less

func (l DestinationList) Less(i, j int) bool

func (DestinationList) Swap

func (l DestinationList) Swap(i, j int)

type ErrConflict

type ErrConflict string

func (ErrConflict) Error

func (e ErrConflict) Error() string

type ErrNotFound

type ErrNotFound string

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type ErrValidation

type ErrValidation struct {
	Type   string
	Errors map[string]string
}

func (ErrValidation) Error

func (e ErrValidation) Error() string

type Service

type Service struct {
	Name       string `validate:"required"`
	Address    string
	Port       uint16 `validate:"gte=1,lte=47808,required"`
	Protocol   string `validate:"protocols,required"`
	Scheduler  string `validate:"schedulers,required"`
	Mode       string `validate:"required"`
	Persistent uint32
}

func (Service) Equal

func (s Service) Equal(svc Service) bool

func (Service) GetId

func (svc Service) GetId() string

func (Service) IpvsId

func (svc Service) IpvsId() string

func (Service) IsNat

func (svc Service) IsNat() bool

Jump to

Keyboard shortcuts

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