cluster

package
v5.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoPurgeAge = 12 * time.Hour

AutoPurgeAge is the maximum age allowed for members' last update when automatically purging.

View Source
var AutoPurgeInterval = 24 * time.Hour

AutoPurgeInterval is the maximum amount of time to wait before automatically purging the cluster of stale members

Functions

This section is empty.

Types

type Cluster

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

Cluster describes the set of ari proxies in a system. The list is indexed by a hash of the asterisk ID and the ARI application and indicates the time of last contact.

func New

func New() *Cluster

New returns a new Cluster

func (*Cluster) All

func (c *Cluster) All(maxAge time.Duration) (list []Member)

All returns a list of all cluster members whose LastActive time is no older thatn the given maxAge.

func (*Cluster) App

func (c *Cluster) App(app string, maxAge time.Duration) (list []Member)

App returns a list of all cluster members for the given ARI Application whose LastActive time is no older than the given maxAge.

func (*Cluster) Matching

func (c *Cluster) Matching(id, app string, maxAge time.Duration) (list []Member)

Matching returns a list of all cluster members for whom the given proxy Metadata matches

func (*Cluster) Purge

func (c *Cluster) Purge(maxAge time.Duration)

Purge removes any proxies in the cluster which are older than the given maxAge.

func (*Cluster) Update

func (c *Cluster) Update(id, app string)

Update adds (or updates) a proxy to/in the cluster

type Member

type Member struct {
	// ID is the unique identifier for the Asterisk node
	ID string

	// App indicates the ARI application of this proxy
	App string

	// LastActive is the timestamp of the last occurrence of this node
	LastActive time.Time
}

Member describes the state of a Member of an application cluster

Jump to

Keyboard shortcuts

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