Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Block(b [PREFIXES]bool)
- func (c *Client) CreateDestination(s Service, d Destination) error
- func (c *Client) CreateService(s Service) error
- func (c *Client) Destinations(s Service) (destinations []DestinationExtended, e error)
- func (c *Client) Flags(f uint8)
- func (c *Client) Info() (i Info)
- func (c *Client) NATAddress(vip, rip netip.Addr) (r netip.Addr, _ bool)
- func (c *Client) Namespace() string
- func (c *Client) NamespaceAddress() string
- func (c *Client) Prefixes() [PREFIXES]uint64
- func (c *Client) ReadFlow() []byte
- func (c *Client) ReattachBPF(nic string) error
- func (c *Client) RemoveDestination(s Service, d Destination) error
- func (c *Client) RemoveService(s Service) error
- func (c *Client) Service(s Service) (se ServiceExtended, e error)
- func (c *Client) Services() (services []ServiceExtended, e error)
- func (c *Client) SetService(s Service, dst ...Destination) error
- func (c *Client) Start() error
- func (c *Client) UpdateVLANs(vlans map[uint16]net.IPNet)
- func (c *Client) WriteFlow(fs []byte)
- type Debug
- type Destination
- type DestinationExtended
- type Info
- type MAC
- type Protocol
- type Service
- type ServiceExtended
- type Stats
Constants ¶
const ( F_NO_SHARE_FLOWS = bpf.F_NO_SHARE_FLOWS F_NO_TRACK_FLOWS = bpf.F_NO_TRACK_FLOWS F_NO_ESTIMATE_CONNS = bpf.F_NO_ESTIMATE_CONNS F_NO_STORE_STATS = bpf.F_NO_STORE_STATS )
const PREFIXES = 1048576
const VETH = bpf.VETH_ID
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { NAT bool Native bool Interfaces []string Address netip.Addr VLANs map[uint16]net.IPNet Debug Debug InitDelay uint8 MaxFlows uint32 // contains filtered or unexported fields }
func (*Client) CreateDestination ¶
func (c *Client) CreateDestination(s Service, d Destination) error
func (*Client) CreateService ¶
func (*Client) Destinations ¶
func (c *Client) Destinations(s Service) (destinations []DestinationExtended, e error)
func (*Client) NATAddress ¶
Return the NAT address of a virtual and real IP address pair - traffic to this address will be translated to target the services on the real server. This address can be used to query the services for health checking purposes.
func (*Client) NamespaceAddress ¶
Retrieve the IP address of the interface in the network namespace that xvs is using
func (*Client) ReadFlow ¶ added in v0.1.3
Retrive a flow state descriptor from the kernel via a queue. Retrieved descriptors can be shared with other load balancers in a cluster to facilitate failover. If no more flows are currently available then the length of the byte slice returned will be zero.
func (*Client) ReattachBPF ¶ added in v0.1.14
Rerun bpf_xdp_attach with the XDP forwarding eBPF code. This can be used to correct an issue with some network cards/drivers which seem to forget about the XDP hook (eg.: Intel X710) after being poked with ethtool (ethtool -r was problematic for me). In a bonded ethernet setup I have had sucess with removing a member from the bond, running ethtool -r, reattaching eBPF and then re-introducting to the bond, with short pauses between each step.
func (*Client) RemoveDestination ¶
func (c *Client) RemoveDestination(s Service, d Destination) error
func (*Client) RemoveService ¶
func (*Client) Services ¶
func (c *Client) Services() (services []ServiceExtended, e error)
func (*Client) SetService ¶ added in v0.1.2
func (c *Client) SetService(s Service, dst ...Destination) error
type Destination ¶
type DestinationExtended ¶
type DestinationExtended struct { Destination Destination MAC MAC Stats Stats }