Documentation ¶
Overview ¶
Package sourceiphash provides a balancer based on the source-ip hash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
GetSourceIP is the default function to get the source ip of the request.
Functions ¶
This section is empty.
Types ¶
type Balancer ¶
type Balancer struct { // GetSourceAddr is used to get the source address. // // If nil, use GetSourceIP or defaults.GetClientIP insead. GetSourceIP func(ctx context.Context, req any) (netip.Addr, error) // contains filtered or unexported fields }
Balancer implements the balancer based on the source-ip hash.
func NewBalancer ¶
NewBalancer returns a new balancer based on the source-ip hash with the policy name.
If policy is empty, use "sourceip_hash" instead.
Click to show internal directories.
Click to hide internal directories.