schema

package
v0.0.0-...-4c5efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "v1"
	LBName  = "lb"
	LBPath  = "/" + Version + "/" + LBName
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadBalancer

type LoadBalancer struct {
	Name    string  `json:"name,omitempty"`
	IP      string  `json:"ip,omitempty"`
	CIDR    string  `json:"cidr,omitempty"`
	Options Options `json:"options,omitempty"`
	Ports   Ports   `json:"ports,omitempty"`
}

func NewLoadBalancerFromBytes

func NewLoadBalancerFromBytes(b []byte) (lb *LoadBalancer, err error)

func (*LoadBalancer) JSON

func (lb *LoadBalancer) JSON() ([]byte, error)

func (*LoadBalancer) ValidateClient

func (lb *LoadBalancer) ValidateClient() error

func (*LoadBalancer) ValidateServer

func (lb *LoadBalancer) ValidateServer() error

type Options

type Options struct {
	Frontend           []string      `json:"frontend,omitempty"`
	Backend            []string      `json:"backend,omitempty"`
	ProxyProtocol      ProxyProtocol `json:"proxyProtocol,omitempty"`
	CheckProxyProtocol bool          `json:"checkProxyProtocol,omitempty"`
	DefaultServer      string        `json:"defaultServer,omitempty`
}

type Port

type Port struct {
	Port    int     `json:"port,omitempty"`
	Servers Servers `json:"servers,omitempty"`
}

type Ports

type Ports []Port

func (Ports) Len

func (p Ports) Len() int

func (Ports) Less

func (p Ports) Less(i, j int) bool

func (Ports) Swap

func (p Ports) Swap(i, j int)

type ProxyProtocol

type ProxyProtocol string
const (
	ProxyProtocolV1 ProxyProtocol = "v1"
	ProxyProtocolV2               = "v2"
)

func ParseProxyProtocol

func ParseProxyProtocol(s string) (pp ProxyProtocol, err error)

type Server

type Server struct {
	Name string `json:"name,omitempty"`
	IP   string `json:"ip,omitempty"`
	Port int    `json:"port,omitempty"`
}

type Servers

type Servers []Server

func (Servers) ContainsIP

func (o Servers) ContainsIP(ip string) bool

func (Servers) ContainsName

func (o Servers) ContainsName(name string) bool

func (Servers) Equal

func (o Servers) Equal(n Servers) bool

func (Servers) IndexOfIP

func (o Servers) IndexOfIP(ip string) int

func (Servers) IndexOfName

func (o Servers) IndexOfName(name string) int

func (Servers) Len

func (s Servers) Len() int

func (Servers) Less

func (s Servers) Less(i, j int) bool

func (Servers) RemoveByIP

func (o Servers) RemoveByIP(ip string) Servers

func (Servers) RemoveByName

func (o Servers) RemoveByName(name string) Servers

func (Servers) Swap

func (s Servers) Swap(i, j int)

Jump to

Keyboard shortcuts

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