Documentation ¶
Index ¶
- func DefaultConfigFilePath() string
- type Configuration
- func (c Configuration) AgentUpdateDuration() time.Duration
- func (c Configuration) Endpoint() string
- func (c *Configuration) Init()
- func (c Configuration) IsLeader() bool
- func (c Configuration) PeerCheckDuration() time.Duration
- func (c Configuration) PeerUpdateDuration() time.Duration
- func (c Configuration) RemoteCheckAssignDuration() time.Duration
- func (c Configuration) RemoteCheckUpdateDuration() time.Duration
- func (c Configuration) URLForPath(path string) string
- type PeerSet
- type Peers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigFilePath ¶
func DefaultConfigFilePath() string
DefaultConfigFilePath returns the context-sensitive default configuration file path.
Types ¶
type Configuration ¶
type Configuration struct { ID uuid.UUID Up bool Peers *Peers ContextFactory model.AppContextFactory Port int Address string AllowCors string AgentUpdateInterval int PeerUpdateInterval int PeerCheckInterval int RemoteCheckUpdateInterval int RemoteCheckAssignInterval int MongoHost string MongoDatabase string MongoUser string MongoPassword string BootstrapPeers []string SMTPHost string SMTPPort int SMTPUser string SMTPPassword string EmailFrom string }
Configuration describes the configuration of the coordinator instance.
func LoadConfig ¶
func LoadConfig(filePath string) (Configuration, error)
LoadConfig from file, overriding defaults with values from file.
func (Configuration) AgentUpdateDuration ¶
func (c Configuration) AgentUpdateDuration() time.Duration
AgentUpdateDuration from AgentUpdateInterval
func (Configuration) Endpoint ¶
func (c Configuration) Endpoint() string
Endpoint address for this coordinator (Address:Port)
func (*Configuration) Init ¶
func (c *Configuration) Init()
Init initializes configuration based on current settings.
func (Configuration) IsLeader ¶
func (c Configuration) IsLeader() bool
IsLeader returns true if this instance is the cluster leader.
func (Configuration) PeerCheckDuration ¶
func (c Configuration) PeerCheckDuration() time.Duration
PeerCheckDuration from PeerCheckInterval
func (Configuration) PeerUpdateDuration ¶
func (c Configuration) PeerUpdateDuration() time.Duration
PeerUpdateDuration from PeerUpdateInterval
func (Configuration) RemoteCheckAssignDuration ¶
func (c Configuration) RemoteCheckAssignDuration() time.Duration
RemoteCheckAssignDuration from RemoteCheckAssignInterval
func (Configuration) RemoteCheckUpdateDuration ¶
func (c Configuration) RemoteCheckUpdateDuration() time.Duration
RemoteCheckUpdateDuration from RemoteCheckUpdateInterval
func (Configuration) URLForPath ¶
func (c Configuration) URLForPath(path string) string
URLForPath returns the full URL for a given API route path.
type PeerSet ¶
type PeerSet map[uuid.UUID]string
PeerSet manages a set of peer Coordinators, mapping unique IDs to endpoints.
func (PeerSet) EndpointArray ¶
EndpointArray returns an array of the endpoints in this PeerSet.
type Peers ¶
type Peers struct { PeerCheckDuration time.Duration PeerUpdateDuration time.Duration // contains filtered or unexported fields }
Peers type handles peer management.
func (*Peers) AddPeer ¶
AddPeer to the known peers list. It will not be added to alive peers until the next peer check, and its known peers won't be added until the next peer update.
func (*Peers) AlivePeerSet ¶
AlivePeerSet returns the set of known live peers as of last check.
func (*Peers) KnownPeerSet ¶
KnownPeerSet returns the set of known peers (regardless of status) as of last update.
func (*Peers) Run ¶
func (p *Peers) Run(conf Configuration) utils.SentinelChannel
Run the peer management routine and return a channel for signalling the routine to stop. Once stopped, all calls to AlivePeerSet/KnownPeerSet/Add will block indefinitely.