Documentation ¶
Index ¶
- Constants
- func DaemonAt(idx int) *gubernator.Daemon
- func FindOwningDaemon(name, key string) (*gubernator.Daemon, error)
- func FindOwningPeer(name, key string) (gubernator.PeerInfo, error)
- func GetDaemons() []*gubernator.Daemon
- func GetPeers() []gubernator.PeerInfo
- func GetRandomPeer(dc string) gubernator.PeerInfo
- func ListNonOwningDaemons(name, key string) ([]*gubernator.Daemon, error)
- func NumOfDaemons() int
- func PeerAt(idx int) gubernator.PeerInfo
- func Restart(ctx context.Context) error
- func Start(numInstances int) error
- func StartWith(localPeers []gubernator.PeerInfo, opts ...option) error
- func Stop()
- func WithEventChannel(eventChannel chan<- gubernator.HitEvent) option
Constants ¶
View Source
const ( DataCenterNone = "" DataCenterOne = "datacenter-1" DataCenterTwo = "datacenter-2" )
Variables ¶
This section is empty.
Functions ¶
func FindOwningDaemon ¶
FindOwningDaemon finds the daemon which owns the rate limit with the provided name and unique key
func FindOwningPeer ¶
FindOwningPeer finds the peer which owns the rate limit with the provided name and unique key
func GetDaemons ¶
func GetDaemons() []*gubernator.Daemon
GetDaemons returns a list of all daemons in the cluster
func GetPeers ¶
func GetPeers() []gubernator.PeerInfo
GetPeers returns a list of all peers in the cluster
func GetRandomPeer ¶
func GetRandomPeer(dc string) gubernator.PeerInfo
GetRandomPeer returns a random peer from the cluster
func ListNonOwningDaemons ¶
ListNonOwningDaemons returns a list of daemons in the cluster that do not own the rate limit for the name and key provided.
func StartWith ¶
func StartWith(localPeers []gubernator.PeerInfo, opts ...option) error
StartWith a local cluster with specific addresses
func WithEventChannel ¶ added in v2.8.1
func WithEventChannel(eventChannel chan<- gubernator.HitEvent) option
WithEventChannel sets EventChannel to Gubernator config.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.