sets

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatcherSet

type DispatcherSet interface {

	// Close shuts down the dispatcher set
	Close()

	// State returns the current state of the DispatcherSet
	State() *State

	// IsMember checks an address for membership in the set
	IsMember(address string, port uint32) bool

	// RegisterChangeFunc registers a callback function which will be invoked whenever the DispatcherSet contents changes.
	RegisterChangeFunc(func(*State))
}

DispatcherSet defines an individual dispatcher set

func NewKubernetesSet

func NewKubernetesSet(ctx context.Context, f informers.SharedInformerFactory, setID int, namespace, name, port string) (DispatcherSet, error)

NewKubernetesSet returns a new kubernetes-based dispatcher set.

  • `setID` is the dispatcher set's id

  • `namespace` is the namespace of the Service whose endpoints will describe this dispatcher set.

  • `name` is the name of the Service whose endpoints will describe this dispatcher set.

  • `port` is the port reference of the SIP endpoints this set describes. This is optional, and if not specified, will default to "5060".

func NewLegacyKubernetesSet added in v2.1.0

func NewLegacyKubernetesSet(ctx context.Context, f informers.SharedInformerFactory, setID int, namespace, name, port string) (DispatcherSet, error)

NewLegacyKunbernetesSet returns a new Kubernetes-based dispatcher set using the older Endpoints method. If the server is running an older version of Kubernetes which does not support v1.EndpointSlices (<v1.21), use this Kubernetes set.

  • `setID` is the dispatcher set's id

  • `namespace` is the namespace of the Service whose endpoints will describe this dispatcher set.

  • `name` is the name of the Service whose endpoints will describe this dispatcher set.

  • `port` is the port reference of the SIP endpoints this set describes. This is optional, and if not specified, will default to "5060".

func NewStaticSet

func NewStaticSet(id int, endpoints []*Endpoint) DispatcherSet

NewStaticSet returns a new statically-defined dispatcher set

type Endpoint

type Endpoint struct {
	Address string
	Port    uint32
}

Endpoint describes an Address:Port pair for a dispatcher endpoint member.

func (*Endpoint) String

func (ep *Endpoint) String() string

type State

type State struct {
	// ID is the unique identifier of the dispatcher set.
	ID int

	// Endpoints is the set of hosts within the dispatcher set.
	Endpoints []*Endpoint
}

Jump to

Keyboard shortcuts

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