loadbalancer

package
v0.0.0-...-9ec06b4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionStateNotTcp      = ConnectionState(0)
	ConnectionStateOpening     = ConnectionState(1)
	ConnectionStateEstablished = ConnectionState(2)
	ConnectionStateClosing     = ConnectionState(3)
	ConnectionStateClosed      = ConnectionState(4)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Id          uint32
	Name        string
	Address     netip.Addr
	MacAddress  net.HardwareAddr
	Iface       netlink.Link
	Status      BackendStatus
	HealthCheck string
	// contains filtered or unexported fields
}

type BackendStatus

type BackendStatus uint32
const (
	BackendStatusAvailable  BackendStatus = BackendStatus(0)
	BackenStatusUnavailable BackendStatus = BackendStatus(1)
)

func (BackendStatus) String

func (b BackendStatus) String() string

type ConnectionState

type ConnectionState uint8

func (ConnectionState) String

func (c ConnectionState) String() string

type ConntrackEntry

type ConntrackEntry struct {
	SrcAddr   netip.Addr
	DstAddr   netip.Addr
	SrcPort   uint32
	DstPort   uint32
	Protocol  protocols.TransportProtocol
	State     ConnectionState
	Timestamp time.Time
	BackendId uint32
	Counter   uint64
}

type LbBackendManager

type LbBackendManager struct {
	// contains filtered or unexported fields
}

func New

func New(vip netip.Addr, upstreamIface string, entry *ebpf.Program, redirectMap, backendInfoMap, backendIfindexMap, upstreamMap *ebpf.Map, conntrack, rrTableMap *ebpf.Map, gcEnabled bool, gcTime time.Duration) (*LbBackendManager, error)

func (*LbBackendManager) Delete

func (l *LbBackendManager) Delete(id uint32) error

ロードバランサーのバックエンドを削除します。

func (*LbBackendManager) DeleteAll

func (l *LbBackendManager) DeleteAll() error

func (*LbBackendManager) Drain

func (l *LbBackendManager) Drain(id uint32) error

ロードバランサーのバックエンドを drain します。 バックエンド削除の前準備のための処理です。 既存のコネクションを処理し続けたまま、新規のコネクションを受け付けないようにします。

func (*LbBackendManager) Get

func (l *LbBackendManager) Get() ([]Backend, error)

ロードバランサーに紐付けられているバックエンドのリストを取得します。

func (*LbBackendManager) GetConntrackEntries

func (l *LbBackendManager) GetConntrackEntries() ([]ConntrackEntry, error)

func (*LbBackendManager) Run

func (l *LbBackendManager) Run(ctx context.Context) error

func (*LbBackendManager) Set

func (l *LbBackendManager) Set(backend *Backend) error

ロードバランサーのバックエンドを追加します。

type Upstream

type Upstream struct {
	IpAddr  netip.Addr
	Index   uint32
	MacAddr net.HardwareAddr
}

Jump to

Keyboard shortcuts

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