Documentation
¶
Index ¶
- func DropNode(nodename string)
- func InitData()
- func PeerURL(nodename string) string
- type Alert
- type CacheData
- type CacheElement
- type Cacher
- type Collector
- type Daemon
- type DaemonLocal
- type Daemondata
- type Dns
- type Heartbeat
- type HeartbeatLastMessage
- type HeartbeatStream
- type HeartbeatStreamPeerStatus
- type HeartbeatStreamPeerStatusTable
- type HeartbeatStreamPeerStatusTableEntry
- type Listener
- type RunnerImon
- type Scheduler
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheData ¶
CacheData defines a shared holder for all nodes Cacher
var ( // DataCollector is the package data holder for all nodes Collector DataCollector *CacheData[Collector] // DataDns is the package data holder for all nodes Dns DataDns *CacheData[Dns] // DataDaemondata is the package data holder for all nodes Daemondata DataDaemondata *CacheData[Daemondata] // DataHeartbeat is the package data holder for all nodes Heartbeat DataHeartbeat *CacheData[Heartbeat] // DataListener is the package data holder for all nodes Listener DataListener *CacheData[Listener] // DataListener is the package data holder for all nodes RunnerImon DataRunnerImon *CacheData[RunnerImon] // DataScheduler is the package data holder for all nodes Scheduler DataScheduler *CacheData[Scheduler] )
func (*CacheData[T]) Get ¶
func (c *CacheData[T]) Get(nodename string) *T
Get return the stored value for nodename or nil if not found
func (*CacheData[T]) GetAll ¶
func (c *CacheData[T]) GetAll() []CacheElement[T]
GetAll returns all stored elements as list of CacheElement[T]
type CacheElement ¶
type Cacher ¶
type Cacher interface {
Collector | Dns | Daemondata | Heartbeat | Listener | RunnerImon | Scheduler
}
type Daemon ¶
type Daemon struct {
// Collector DaemonCollector describes the OpenSVC daemon collector subsystem state,
// which is responsible for communicating with the collector on behalf
// of the cluster. Only one node on the cluster is the collector speaker
Collector Collector `json:"collector"`
// Daemondata DaemonDaemondata describes the OpenSVC daemon data subsystem state,
// which is responsible for aggregating data messages and selecting
// candidate data messages to forward to peer nodes.
Daemondata Daemondata `json:"daemondata"`
// Dns describes the OpenSVC daemon dns subsystem state, which is
// responsible for janitoring and serving the cluster Dns zone.
// This zone is dynamically populated by ip address allocated for the
// services (frontend and backend).
Dns Dns `json:"dns"`
Heartbeat Heartbeat `json:"heartbeat"`
// Listener DaemonListener describes the OpenSVC daemon listener subsystem state,
// which is responsible for serving the API.
Listener Listener `json:"listener"`
Nodename string `json:"nodename"`
// Pid the main daemon process id
// it is sent on the full hb message, then not anymore changed
Pid int `json:"pid"`
// StartedAt is the time when daemon has been started
// it is sent on the full hb message, then not anymore changed
StartedAt time.Time `json:"started_at"`
RunnerImon RunnerImon `json:"runner_imon"`
// Scheduler DaemonScheduler describes the OpenSVC daemon scheduler subsystem state,
// which is responsible for executing node and objects scheduled jobs.
Scheduler Scheduler `json:"scheduler"`
}
Daemon defines model for Daemon.
type DaemonLocal ¶
type DaemonLocal struct {
// Nodename is used to identify the nodename that have sent Daemon struct
Nodename string `json:"nodename"`
Routines int `json:"routines"`
}
DaemonLocal defines model for DaemonLocal data that are not sent to peers.
type Daemondata ¶
type Daemondata struct {
Status
// QueueSize the subscription queue size
QueueSize int `json:"queue_size"`
}
Daemondata defines model for Daemondata.
func (*Daemondata) DeepCopy ¶
func (c *Daemondata) DeepCopy() *Daemondata
type Dns ¶
type Dns struct {
Status
// Nameservers list of nameservers
Nameservers []string `json:"nameservers"`
}
Dns defines model for Dns daemon subsystem.
type Heartbeat ¶
type Heartbeat struct {
// LastMessages is the last messages details received from cluster
// peer nodes plus the last message details localhost has sent.
LastMessages []HeartbeatLastMessage `json:"last_messages"`
// LastMessage is the last message sent from localhost
LastMessage HeartbeatLastMessage `json:"last_message"`
// Streams list of daemon heartbeat streams
Streams []HeartbeatStream `json:"streams"`
SecretVersion struct {
Main uint64 `json:"main"`
Alternate uint64 `json:"alt"`
} `json:"secret_version"`
UpdatedAt time.Time `json:"updated_at"`
}
Heartbeat defines model for Daemon Heartbeat subsystem.
type HeartbeatLastMessage ¶
type HeartbeatStream ¶
type HeartbeatStream struct {
Status
// Type of heartbeat stream (unicast, multicast, ...)
Type string `json:"type"`
// Peers map of peer names to daemon hb stream peer status
Peers map[string]HeartbeatStreamPeerStatus `json:"peers"`
Alerts []Alert `json:"alerts"`
}
HeartbeatStream defines model for Heartbeat Stream (a sending or receiving heartbeat).
- a sending daemon heartbeat is responsible for sending node dataset changes to peers
- a receiving daemon heartbeat is responsible for receiving node dataset changes from peers
func (*HeartbeatStream) DeepCopy ¶
func (c *HeartbeatStream) DeepCopy() *HeartbeatStream
type HeartbeatStreamPeerStatus ¶
type HeartbeatStreamPeerStatus struct {
Desc string `json:"desc"`
IsBeating bool `json:"is_beating"`
// ChangedAt is the time of IsBeating value changed
ChangedAt time.Time `json:"changed_at"`
// LastBeatingAt is the last beating time
LastBeatingAt time.Time `json:"last_beating_at"`
}
HeartbeatStreamPeerStatus status of the communication with a specific peer node.
type HeartbeatStreamPeerStatusTable ¶
type HeartbeatStreamPeerStatusTable []HeartbeatStreamPeerStatusTableEntry
type HeartbeatStreamPeerStatusTableEntry ¶
type HeartbeatStreamPeerStatusTableEntry struct {
Node string `json:"node"`
Peer string `json:"peer"`
Status
Type string `json:"type"`
Alerts []Alert `json:"alerts"`
HeartbeatStreamPeerStatus
IsSingleNode bool `json:"-"`
}
func (HeartbeatStreamPeerStatusTableEntry) Unstructured ¶
func (t HeartbeatStreamPeerStatusTableEntry) Unstructured() map[string]any
type Listener ¶
type Listener struct {
Status
Addr string `json:"addr"`
Port string `json:"port"`
RateLimiter cluster.RateLimiterConfig `json:"rate_limiter"`
}
Listener defines daemon Listener subsystem state.
type RunnerImon ¶
RunnerImon defines the daemon runner for imon subsystem.
func (*RunnerImon) DeepCopy ¶
func (c *RunnerImon) DeepCopy() *RunnerImon
type Scheduler ¶
type Scheduler struct {
Status
// Count is the number of defined scheduled jobs
Count int `json:"count"`
// MaxRunning is the maximum number of running jobs
MaxRunning int `json:"max_running"`
}
Scheduler defines model for daemon scheduler subsystem.
type Status ¶
type Status struct {
ID string `json:"id"`
State string `json:"state"`
ConfiguredAt time.Time `json:"configured_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Status describes a OpenSVC daemon subsystem: when it was last created, configured an updated, what its current state is and its id.