types

package
v0.0.0-...-ee29da7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GET method
	GET = Action("GET")
	// POST method
	POST = Action("POST")
	// DELETE method
	DELETE = Action("DELETE")
)

Action types

View Source
const (
	// HTTP protocol
	HTTP = Protocol("http")
	// HTTPS protocol
	HTTPS = Protocol("https")
)
View Source
const (
	// NFTLBport defines which port is the default nftlb port
	NFTLBport = Port(5555)
	// HTTPport defines which port is the default HTTP port
	HTTPport = Port(80)
	// HTTPSport defines which port is the default HTTPS port
	HTTPSport = Port(443)
)
View Source
const (
	// IPv4 = version 4
	IPv4 = IPversion(4)
)

Variables

View Source
var (
	// LocalHostIPv4 defines the localhost IP (IPv4)
	LocalHostIPv4 = IP{127, 0, 0, 1}
)

Functions

This section is empty.

Types

type Action

type Action string

Action defines the request type.

func (Action) String

func (a Action) String() string

type Backend

type Backend struct {
	Name     string `json:"name"`
	IPAddr   string `json:"ip-addr"`
	Weight   string `json:"weight,omitempty"`
	Priority string `json:"priority,omitempty"`
	Mark     string `json:"mark,omitempty"`
	State    string `json:"state,omitempty"`
}

Backend defines any backend with its properties.

type Backends

type Backends []Backend

Backends defines a group of backends in any farm.

type Farm

type Farm struct {
	Name         string   `json:"name"`
	Iface        string   `json:"iface,omitempty"`
	Oface        string   `json:"oface,omitempty"`
	Family       string   `json:"family,omitempty"`
	EtherAddr    string   `json:"ether-addr,omitempty"`
	VirtualAddr  string   `json:"virtual-addr,omitempty"`
	VirtualPorts string   `json:"virtual-ports,omitempty"`
	Mode         string   `json:"mode,omitempty"`
	Protocol     string   `json:"protocol,omitempty"`
	Scheduler    string   `json:"scheduler,omitempty"`
	Helper       string   `json:"helper,omitempty"`
	Log          string   `json:"log,omitempty"`
	Mark         string   `json:"mark,omitempty"`
	Priority     string   `json:"priority,omitempty"`
	State        string   `json:"state,omitempty"`
	Backends     Backends `json:"backends"`
}

Farm defines any farm with its properties.

type Farms

type Farms []Farm

Farms defines a group of farms.

type Header struct {
	Key   string
	Value string
}

Header is a custom struct that contains a key-value pair as strings.

type IP

type IP []byte

IP defines how to format the IP.

func (IP) ToIPv4

func (ip IP) ToIPv4() string

ToIPv4 returns a string with the referred IP formatted as IPv4.

type IPversion

type IPversion byte

IPversion defines which IP versions are supported.

type JSONnftlb

type JSONnftlb struct {
	Farms Farms `json:"farms"`
}

JSONnftlb is a JSON object made for nftlb requests.

type Payload

type Payload io.Reader

Payload is the body in a POST request, and nil otherwise.

type Port

type Port int

Port defines which ports are supported.

type Protocol

type Protocol string

Protocol defines which protocols are supported.

type Request

type Request struct {
	Header  *Header
	Action  Action
	URL     *URL
	Payload Payload
}

Request is a custom struct that contains the data needed for a regular request.

type URL

type URL struct {
	Protocol  Protocol
	IPversion IPversion
	IP        IP
	Port      Port
	Path      string
}

URL has different fields that match any regular URL.

func (URL) String

func (u URL) String() string

Jump to

Keyboard shortcuts

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