sticktable

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryKey

type BinaryKey []byte

func (*BinaryKey) Marshal

func (v *BinaryKey) Marshal(b []byte, keySize uint64) (int, error)

func (*BinaryKey) String

func (v *BinaryKey) String() string

func (*BinaryKey) Unmarshal

func (v *BinaryKey) Unmarshal(b []byte, keySize uint64) (int, error)

type DataType

type DataType int
const (
	// DataTypeServerId represents the server ID to use with this
	// represents a stream if > 0
	DataTypeServerId DataType = iota
	// DataTypeGPT0 represents a General Purpose Flag 0.
	DataTypeGPT0
	// DataTypeGPC0 represents a General Purpose Counter 0 (unsigned 32-bit integer)
	DataTypeGPC0
	// DataTypeGPC0Rate represents a General Purpose Counter 0's event rate
	DataTypeGPC0Rate
	// DataTypeConnectionsCounter represents a cumulated number of connections
	DataTypeConnectionsCounter
	// DataTypeConnectionRate represents an incoming connection rate
	DataTypeConnectionRate
	// DataTypeNumberOfCurrentConnections represents a concurrent number of connections
	DataTypeNumberOfCurrentConnections
	// DataTypeSessionsCounter represents a cumulated number of sessions (accepted connections)
	DataTypeSessionsCounter
	// DataTypeSessionRate represents an accepted sessions rate
	DataTypeSessionRate
	// DataTypeHttpRequestsCounter represents a cumulated number of incoming HTTP requests
	DataTypeHttpRequestsCounter
	// DataTypeHttpRequestsRate represents an incoming HTTP request rate
	DataTypeHttpRequestsRate
	// DataTypeErrorsCounter represents a cumulated number of HTTP requests errors (4xx)
	DataTypeErrorsCounter
	// DataTypeErrorsRate represents an HTTP request error rate
	DataTypeErrorsRate
	// DataTypeBytesInCounter represents a cumulated bytes count from client to servers
	DataTypeBytesInCounter
	// DataTypeBytesInRate represents a bytes rate from client to servers
	DataTypeBytesInRate
	// DataTypeBytesOutCounter represents a cumulated bytes count from servers to client
	DataTypeBytesOutCounter
	// DataTypeBytesOutRate represents a bytes rate from servers to client
	DataTypeBytesOutRate
	// DataTypeGPC1 represents a General Purpose Counter 1 (unsigned 32-bit integer)
	DataTypeGPC1
	// DataTypeGPC1Rate represents a General Purpose Counter 1's event rate
	DataTypeGPC1Rate
	// DataTypeServerKey represents the server key
	DataTypeServerKey
	// DataTypeHttpFailCounter represents a cumulated number of HTTP server failures
	DataTypeHttpFailCounter
	// DataTypeHttpFailRate represents an HTTP server failures rate
	DataTypeHttpFailRate
	// DataTypeGPTArray represents an array of gpt
	DataTypeGPTArray
	// DataTypeGPCArray represents an array of gpc
	DataTypeGPCArray
	// DataTypeGPCRateArray represents an array of gpc_rate
	DataTypeGPCRateArray
	// DataTypeGlitchCounter represents a cumulated number of front glitches
	DataTypeGlitchCounter
	// DataTypeGlitchRate represents a rate of front glitches
	DataTypeGlitchRate
)

The types of extra data we can store in a stick table

func (DataType) IsDelay

func (d DataType) IsDelay() bool

func (DataType) New

func (d DataType) New() MapData

func (DataType) String

func (d DataType) String() string

type DataTypeDefinition

type DataTypeDefinition struct {
	DataType DataType
	Counter  uint64
	Period   uint64
}

type Definition

type Definition struct {
	Name         string
	DataTypes    []DataTypeDefinition
	KeyType      KeyType
	StickTableID uint64
	KeyLength    uint64
	Expiry       uint64
}

func (*Definition) Marshal

func (s *Definition) Marshal(b []byte) (int, error)

func (*Definition) Unmarshal

func (s *Definition) Unmarshal(b []byte) (int, error)

type DictData

type DictData struct {
	Value []byte
	ID    uint64
}

func (*DictData) Marshal

func (f *DictData) Marshal(b []byte) (int, error)

func (*DictData) String

func (f *DictData) String() string

func (*DictData) Unmarshal

func (f *DictData) Unmarshal(b []byte) (int, error)

type EntryUpdate

type EntryUpdate struct {
	StickTable *Definition
	Key        MapKey
	Data       []MapData

	WithLocalUpdateID bool
	LocalUpdateID     uint32

	WithExpiry bool
	Expiry     uint32
}

func (*EntryUpdate) Marshal

func (e *EntryUpdate) Marshal(b []byte) (int, error)

func (*EntryUpdate) String

func (e *EntryUpdate) String() string

func (*EntryUpdate) Unmarshal

func (e *EntryUpdate) Unmarshal(b []byte) (int, error)

type FreqData

type FreqData struct {
	CurrentTick   uint64
	CurrentPeriod uint64
	LastPeriod    uint64
}

func (*FreqData) Marshal

func (f *FreqData) Marshal(b []byte) (int, error)

func (*FreqData) String

func (f *FreqData) String() string

func (*FreqData) Unmarshal

func (f *FreqData) Unmarshal(b []byte) (int, error)

type IPv4AddressKey

type IPv4AddressKey netip.Addr

func (*IPv4AddressKey) Marshal

func (v *IPv4AddressKey) Marshal(b []byte, keySize uint64) (int, error)

func (*IPv4AddressKey) String

func (v *IPv4AddressKey) String() string

func (*IPv4AddressKey) Unmarshal

func (v *IPv4AddressKey) Unmarshal(b []byte, keySize uint64) (int, error)

type IPv6AddressKey

type IPv6AddressKey netip.Addr

func (*IPv6AddressKey) Marshal

func (v *IPv6AddressKey) Marshal(b []byte, keySize uint64) (int, error)

func (*IPv6AddressKey) String

func (v *IPv6AddressKey) String() string

func (*IPv6AddressKey) Unmarshal

func (v *IPv6AddressKey) Unmarshal(b []byte, keySize uint64) (int, error)

type KeyType

type KeyType int
const (
	KeyTypeAny KeyType = iota
	KeyTypeBoolean
	KeyTypeSignedInteger
	KeyTypeAddress
	KeyTypeIPv4Address
	KeyTypeIPv6Address
	KeyTypeString
	KeyTypeBinary
	KeyTypeMethod
)

This is the different key types of the stick tables. Same definitions as in HAProxy sources.

func (KeyType) New

func (t KeyType) New() MapKey

func (KeyType) String

func (i KeyType) String() string

type MapData

type MapData interface {
	fmt.Stringer
	Unmarshal(b []byte) (int, error)
	Marshal(b []byte) (int, error)
}

type MapKey

type MapKey interface {
	fmt.Stringer
	Unmarshal(b []byte, keySize uint64) (int, error)
	Marshal(b []byte, keySize uint64) (int, error)
}

type SignedIntegerData

type SignedIntegerData int32

func (*SignedIntegerData) Marshal

func (v *SignedIntegerData) Marshal(b []byte) (int, error)

func (*SignedIntegerData) String

func (v *SignedIntegerData) String() string

func (*SignedIntegerData) Unmarshal

func (v *SignedIntegerData) Unmarshal(b []byte) (int, error)

type SignedIntegerKey

type SignedIntegerKey int32

func (*SignedIntegerKey) Marshal

func (v *SignedIntegerKey) Marshal(b []byte, keySize uint64) (int, error)

func (*SignedIntegerKey) String

func (v *SignedIntegerKey) String() string

func (*SignedIntegerKey) Unmarshal

func (v *SignedIntegerKey) Unmarshal(b []byte, keySize uint64) (int, error)

type StringKey

type StringKey string

func (*StringKey) Marshal

func (v *StringKey) Marshal(b []byte, keySize uint64) (int, error)

func (*StringKey) String

func (v *StringKey) String() string

func (*StringKey) Unmarshal

func (v *StringKey) Unmarshal(b []byte, keySize uint64) (int, error)

type UnsignedIntegerData

type UnsignedIntegerData uint32

func (*UnsignedIntegerData) Marshal

func (v *UnsignedIntegerData) Marshal(b []byte) (int, error)

func (*UnsignedIntegerData) String

func (v *UnsignedIntegerData) String() string

func (*UnsignedIntegerData) Unmarshal

func (v *UnsignedIntegerData) Unmarshal(b []byte) (int, error)

type UnsignedLongLongData

type UnsignedLongLongData uint64

func (*UnsignedLongLongData) Marshal

func (v *UnsignedLongLongData) Marshal(b []byte) (int, error)

func (*UnsignedLongLongData) String

func (v *UnsignedLongLongData) String() string

func (*UnsignedLongLongData) Unmarshal

func (v *UnsignedLongLongData) Unmarshal(b []byte) (int, error)

Jump to

Keyboard shortcuts

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