msgbus

package
v0.0.0-...-3f873ad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package msgbus defines the Opensvc messages

	 Add new message msgX: msgbus/messages.go
		- defines the new message: type <msgX> struct ....
          add kindToT["msgX"]
		- msgX should implement event.Kinder
		- if msgX can change ClusterData:
	       - create ClusterData.onMsgX function
	       - update ClusterData.ApplyMessage function
		- msgX must be sent to peers (to patch):
			- update daemondata.startSubscriptions function
			- update daemondata.localEventMustBeForwarded function
		- peer msgX is received from peer (from patch):
			- update setCacheAndPublish function:
				- can update some caches
				- republish event with label from: peer
		- peer msgX may be published from full diff during applyNodeData
		- dropPeer may also publish associated messages:
          examples:
         	- drop peer node must also publish InstanceConfigDeleted, ...
              => InstanceConfigUpdated needs publish InstanceConfigDeleted
			- drop peer node may publish empty DaemonXXXUpdated to reset
			  daemon subsystem state

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropPendingMsg

func DropPendingMsg(c <-chan any, duration time.Duration)

func EventToMessage

func EventToMessage(ev event.Event) (pubsub.Messager, error)

EventToMessage converts event.Event message as pubsub.Messager

func KindToT

func KindToT(kind string) (any, error)

Types

type ArbitratorError

type ArbitratorError struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`
	Name       string `json:"name" yaml:"name"`
	ErrS       string `json:"error" yaml:"error"`
}

ArbitratorError message is published when an arbitrator error is detected

func (*ArbitratorError) Kind

func (e *ArbitratorError) Kind() string

type ClientSubscribed

type ClientSubscribed struct {
	pubsub.Msg `yaml:",inline"`
	Time       time.Time `json:"at" yaml:"at"`
	Name       string    `json:"name" yaml:"name"`
}

func (*ClientSubscribed) Kind

func (e *ClientSubscribed) Kind() string

func (*ClientSubscribed) String

func (e *ClientSubscribed) String() string

type ClientUnsubscribed

type ClientUnsubscribed struct {
	pubsub.Msg `yaml:",inline"`
	Time       time.Time `json:"at" yaml:"at"`
	Name       string    `json:"name" yaml:"name"`
}

func (*ClientUnsubscribed) Kind

func (e *ClientUnsubscribed) Kind() string

func (*ClientUnsubscribed) String

func (e *ClientUnsubscribed) String() string

type ClusterConfigUpdated

type ClusterConfigUpdated struct {
	pubsub.Msg   `yaml:",inline"`
	Node         string         `json:"node" yaml:"node"`
	Value        cluster.Config `json:"cluster_config" yaml:"cluster_config"`
	NodesAdded   []string       `json:"nodes_added" yaml:"nodes_added"`
	NodesRemoved []string       `json:"nodes_removed" yaml:"nodes_removed"`
}

func (*ClusterConfigUpdated) Kind

func (e *ClusterConfigUpdated) Kind() string

type ClusterData

type ClusterData struct {
	*clusterdump.Data
	// contains filtered or unexported fields
}

ClusterData struct holds cluster data that can be updated with msg

func NewClusterData

func NewClusterData(cd *clusterdump.Data) *ClusterData

func (*ClusterData) ApplyMessage

func (data *ClusterData) ApplyMessage(m pubsub.Messager)

func (*ClusterData) OnObjectStatusDeleted

func (data *ClusterData) OnObjectStatusDeleted(m *ObjectStatusDeleted)

OnObjectStatusDeleted delete .cluster.object.<path>

func (*ClusterData) OnObjectStatusUpdated

func (data *ClusterData) OnObjectStatusUpdated(m *ObjectStatusUpdated)

OnObjectStatusUpdated updates .cluster.object.<path>

type ClusterStatusUpdated

type ClusterStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string             `json:"node" yaml:"node"`
	Value      clusterdump.Status `json:"cluster_status" yaml:"cluster_status"`
}

func (*ClusterStatusUpdated) Kind

func (e *ClusterStatusUpdated) Kind() string

type ConfigFileRemoved

type ConfigFileRemoved struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	File       string      `json:"file" yaml:"file"`
}

ConfigFileRemoved is emitted by a fs watcher when a .conf file is removed in etc. The imon goroutine listens to this event and updates the daemondata, which in turns emits a InstanceConfigDeleted{} event.

func (*ConfigFileRemoved) Kind

func (e *ConfigFileRemoved) Kind() string

type ConfigFileUpdated

type ConfigFileUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	File       string      `json:"file" yaml:"file"`
}

ConfigFileUpdated is emitted by a fs watcher when a .conf file is updated or created in etc. The imon goroutine listens to this event and updates the daemondata, which in turns emits a InstanceConfigUpdated{} event.

func (*ConfigFileUpdated) Kind

func (e *ConfigFileUpdated) Kind() string

type DaemonCollectorUpdated

type DaemonCollectorUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.Collector `json:"collector" yaml:"collector"`
}

func (*DaemonCollectorUpdated) Kind

func (e *DaemonCollectorUpdated) Kind() string

type DaemonCtl

type DaemonCtl struct {
	pubsub.Msg `yaml:",inline"`
	Component  string `json:"component" yaml:"component"`
	Action     string `json:"action" yaml:"action"`
}

func (*DaemonCtl) Kind

func (e *DaemonCtl) Kind() string

type DaemonDataUpdated

type DaemonDataUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.Daemondata `json:"daemondata" yaml:"daemondata"`
}

func (*DaemonDataUpdated) Kind

func (e *DaemonDataUpdated) Kind() string

type DaemonDnsUpdated

type DaemonDnsUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.Dns `json:"dns" yaml:"dns"`
}

func (*DaemonDnsUpdated) Kind

func (e *DaemonDnsUpdated) Kind() string

type DaemonHeartbeatUpdated

type DaemonHeartbeatUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.Heartbeat `json:"hb" yaml:"hb"`
}

func (*DaemonHeartbeatUpdated) Kind

func (e *DaemonHeartbeatUpdated) Kind() string

type DaemonListenerUpdated

type DaemonListenerUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string                   `json:"node" yaml:"node"`
	Value      daemonsubsystem.Listener `json:"listener" yaml:"listener"`
}

func (*DaemonListenerUpdated) Kind

func (e *DaemonListenerUpdated) Kind() string

type DaemonRunnerImonUpdated

type DaemonRunnerImonUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.RunnerImon `json:"runner_imon" yaml:"runner_imon"`
}

func (*DaemonRunnerImonUpdated) Kind

func (e *DaemonRunnerImonUpdated) Kind() string

type DaemonSchedulerUpdated

type DaemonSchedulerUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.Scheduler `json:"scheduler" yaml:"scheduler"`
}

func (*DaemonSchedulerUpdated) Kind

func (e *DaemonSchedulerUpdated) Kind() string

type DaemonStatusUpdated

type DaemonStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`
	Version    string `json:"version" yaml:"version"`
	Status     string `json:"status" yaml:"status"`
}

DaemonStatusUpdated message informs about main daemon status

func (*DaemonStatusUpdated) Kind

func (e *DaemonStatusUpdated) Kind() string

type Exec

type Exec struct {
	pubsub.Msg `yaml:",inline"`
	Command    string `json:"command" yaml:"command"`
	// Node is the nodename that will call exec
	Node string `json:"node" yaml:"node"`
	// Origin describes the exec caller: example: imon, nmon, scheduler...
	Origin    string    `json:"origin" yaml:"origin"`
	Title     string    `json:"title" yaml:"title"`
	SessionID uuid.UUID `json:"session_id" yaml:"session_id"`
}

Exec message describes an exec call

func (*Exec) Kind

func (e *Exec) Kind() string

type ExecFailed

type ExecFailed struct {
	pubsub.Msg `yaml:",inline"`
	Command    string        `json:"command" yaml:"command"`
	Duration   time.Duration `json:"duration" yaml:"duration"`
	ErrS       string        `json:"error" yaml:"error"`
	// Node is the nodename that called exec
	Node string `json:"node" yaml:"node"`
	// Origin describes the exec caller: example: imon, nmon, scheduler...
	Origin    string    `json:"origin" yaml:"origin"`
	Title     string    `json:"title" yaml:"title"`
	SessionID uuid.UUID `json:"session_id" yaml:"session_id"`
}

ExecFailed message describes failed exec call

func (*ExecFailed) Kind

func (e *ExecFailed) Kind() string

type ExecSuccess

type ExecSuccess struct {
	pubsub.Msg `yaml:",inline"`
	Command    string        `json:"command" yaml:"command"`
	Duration   time.Duration `json:"duration" yaml:"duration"`
	// Node is the nodename that called exec
	Node string `json:"node" yaml:"node"`
	// Origin describes the exec caller: example: imon, nmon, scheduler...
	Origin    string    `json:"origin" yaml:"origin"`
	Title     string    `json:"title" yaml:"title"`
	SessionID uuid.UUID `json:"session_id" yaml:"session_id"`
}

ExecSuccess message describes successfully exec call

func (*ExecSuccess) Kind

func (e *ExecSuccess) Kind() string

type Exit

type Exit struct {
	Path naming.Path `json:"path" yaml:"path"`
	File string      `json:"file" yaml:"file"`
}

func (*Exit) Kind

func (e *Exit) Kind() string

type ForgetPeer

type ForgetPeer struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`
}

func (*ForgetPeer) Kind

func (e *ForgetPeer) Kind() string

Kind returns the kind value for ForgetPeer TODO: change to "ForgetPeer" TODO: document CHANGELOG.md: forget_peer (b2.1) -> ForgetPeer TODO: remove "forget_peer" from core/om/text/node-events/event-kind

type HbMessageTypeUpdated

type HbMessageTypeUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string   `json:"node" yaml:"node"`
	From       string   `json:"old_type" yaml:"old_type"`
	To         string   `json:"new_type" yaml:"new_type"`
	Nodes      []string `json:"nodes" yaml:"nodes"`

	// JoinedNodes are nodes with hb message type patch
	JoinedNodes []string `json:"joined_nodes" yaml:"joined_nodes"`

	// InstalledGens are the current installed node gens
	InstalledGens map[string]uint64 `json:"installed_gens" yaml:"installed_gens"`
}

func (*HbMessageTypeUpdated) Kind

func (e *HbMessageTypeUpdated) Kind() string

type HbNodePing

type HbNodePing struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`
	IsAlive    bool   `json:"is_alive" yaml:"is_alive"`
}

func (*HbNodePing) Kind

func (e *HbNodePing) Kind() string

func (*HbNodePing) String

func (e *HbNodePing) String() string

type HbPing

type HbPing struct {
	pubsub.Msg `yaml:",inline"`
	Nodename   string    `json:"to" yaml:"to"`
	HbID       string    `json:"hb_id" yaml:"hb_id"`
	Time       time.Time `json:"at" yaml:"at"`
}

func (*HbPing) Kind

func (e *HbPing) Kind() string

func (*HbPing) String

func (e *HbPing) String() string

type HbStale

type HbStale struct {
	pubsub.Msg `yaml:",inline"`
	Nodename   string    `json:"node" yaml:"node"`
	HbID       string    `json:"hb_id" yaml:"hb_id"`
	Time       time.Time `json:"at" yaml:"at"`
}

func (*HbStale) Kind

func (e *HbStale) Kind() string

func (*HbStale) String

func (e *HbStale) String() string

type HbStatusUpdated

type HbStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	Value daemonsubsystem.HeartbeatStream `json:"stream" yaml:"stream"`
}

func (*HbStatusUpdated) Kind

func (e *HbStatusUpdated) Kind() string

type InstanceConfigDeleted

type InstanceConfigDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

func (*InstanceConfigDeleted) Kind

func (e *InstanceConfigDeleted) Kind() string

type InstanceConfigDeleting

type InstanceConfigDeleting struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

InstanceConfigDeleting event is pushed during imon orchestration deleting step.

func (*InstanceConfigDeleting) Kind

func (e *InstanceConfigDeleting) Kind() string

type InstanceConfigFor

type InstanceConfigFor struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
	// Orchestrate is the config orchestrate value. it may be used by peers
	// just after installation of fetched instance config file
	Orchestrate string `json:"orchestrate" yaml:"orchestrate"`
	// Scope is the list of nodes that have to fetch this config
	Scope []string `json:"scope" yaml:"scope"`
	// UpdatedAt is the config file time stamp
	UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"`
}

InstanceConfigFor message is published by a node during analyse of instance config file that is scoped for foreign nodes (peers).

func (*InstanceConfigFor) Kind

func (e *InstanceConfigFor) Kind() string

type InstanceConfigManagerDone

type InstanceConfigManagerDone struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	File       string      `json:"file" yaml:"file"`
}

func (*InstanceConfigManagerDone) Kind

type InstanceConfigUpdated

type InstanceConfigUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path     `json:"path" yaml:"path"`
	Node       string          `json:"node" yaml:"node"`
	Value      instance.Config `json:"instance_config" yaml:"instance_config"`
}

func (*InstanceConfigUpdated) Kind

func (e *InstanceConfigUpdated) Kind() string

type InstanceFrozenFileRemoved

type InstanceFrozenFileRemoved struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	File       string      `json:"file" yaml:"file"`
	At         time.Time   `json:"at" yaml:"at"`
}

InstanceFrozenFileRemoved is emitted by a fs watcher or iman when an instance frozen file is removed.

func (*InstanceFrozenFileRemoved) Kind

type InstanceFrozenFileUpdated

type InstanceFrozenFileUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	File       string      `json:"file" yaml:"file"`
	At         time.Time   `json:"at" yaml:"at"`
}

InstanceFrozenFileUpdated is emitted by a fs watcher, or imon when an instance frozen file is updated or created.

func (*InstanceFrozenFileUpdated) Kind

type InstanceMonitorAction

type InstanceMonitorAction struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path            `json:"path" yaml:"path"`
	Node       string                 `json:"node" yaml:"node"`
	Action     instance.MonitorAction `json:"action" yaml:"action"`
	RID        string                 `json:"rid" yaml:"rid"`
}

func (*InstanceMonitorAction) Kind

func (e *InstanceMonitorAction) Kind() string

type InstanceMonitorDeleted

type InstanceMonitorDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

func (*InstanceMonitorDeleted) Kind

func (e *InstanceMonitorDeleted) Kind() string

type InstanceMonitorUpdated

type InstanceMonitorUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path      `json:"path" yaml:"path"`
	Node       string           `json:"node" yaml:"node"`
	Value      instance.Monitor `json:"instance_monitor" yaml:"instance_monitor"`
}

func (*InstanceMonitorUpdated) Kind

func (e *InstanceMonitorUpdated) Kind() string

type InstanceStatusDeleted

type InstanceStatusDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

func (*InstanceStatusDeleted) Kind

func (e *InstanceStatusDeleted) Kind() string

type InstanceStatusPost

type InstanceStatusPost struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path     `json:"path" yaml:"path"`
	Node       string          `json:"node" yaml:"node"`
	Value      instance.Status `json:"instance_status" yaml:"instance_status"`
}

func (*InstanceStatusPost) Kind

func (e *InstanceStatusPost) Kind() string

type InstanceStatusUpdated

type InstanceStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path     `json:"path" yaml:"path"`
	Node       string          `json:"node" yaml:"node"`
	Value      instance.Status `json:"instance_status" yaml:"instance_status"`
}

func (*InstanceStatusUpdated) Kind

func (e *InstanceStatusUpdated) Kind() string

type JoinError

type JoinError struct {
	pubsub.Msg `yaml:",inline"`
	// Node is a node that can't be added to cluster config nodes
	Node   string `json:"node" yaml:"node"`
	Reason string `json:"reason" yaml:"reason"`
}

func (*JoinError) Kind

func (e *JoinError) Kind() string

type JoinIgnored

type JoinIgnored struct {
	pubsub.Msg `yaml:",inline"`
	// Node is a node that is already in cluster config nodes
	Node string `json:"node" yaml:"node"`
}

func (*JoinIgnored) Kind

func (e *JoinIgnored) Kind() string

type JoinRequest

type JoinRequest struct {
	pubsub.Msg `yaml:",inline"`
	// Node is a node to add to cluster config nodes
	Node string `json:"node" yaml:"node"`
}

func (*JoinRequest) Kind

func (e *JoinRequest) Kind() string

type JoinSuccess

type JoinSuccess struct {
	pubsub.Msg `yaml:",inline"`
	// Node is the successfully added node in cluster config nodes
	Node string `json:"node" yaml:"node"`
}

func (*JoinSuccess) Kind

func (e *JoinSuccess) Kind() string

type LeaveError

type LeaveError struct {
	pubsub.Msg `yaml:",inline"`
	// Node is a node that can't be removed from cluster config nodes
	Node   string `json:"node" yaml:"node"`
	Reason string
}

func (*LeaveError) Kind

func (e *LeaveError) Kind() string

type LeaveIgnored

type LeaveIgnored struct {
	pubsub.Msg `yaml:",inline"`
	// Node is a node that is not in cluster config nodes
	Node string `json:"node" yaml:"node"`
}

func (*LeaveIgnored) Kind

func (e *LeaveIgnored) Kind() string

type LeaveRequest

type LeaveRequest struct {
	pubsub.Msg `yaml:",inline"`
	// Node is a node to remove to cluster config nodes
	Node string `json:"node" yaml:"node"`
}

func (*LeaveRequest) Kind

func (e *LeaveRequest) Kind() string

type LeaveSuccess

type LeaveSuccess struct {
	pubsub.Msg `yaml:",inline"`
	// Node is the successfully removed node from cluster config nodes
	Node string `json:"node" yaml:"node"`
}

func (*LeaveSuccess) Kind

func (e *LeaveSuccess) Kind() string

type Log

type Log struct {
	pubsub.Msg `yaml:",inline"`
	Message    string `json:"message" yaml:"message"`
	Level      string `json:"level" yaml:"level"`
}

Log is a log message.

Usage example: labels := []pubsub.Label{{"subsystem", "imon"}, {"path", p.String()}} pubsubBus.Pub(&msgbus.Log{Message: "orchestrate", Level: "debug"}, labels...)

func (*Log) Kind

func (e *Log) Kind() string

type NodeConfigUpdated

type NodeConfigUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string      `json:"node" yaml:"node"`
	Value      node.Config `json:"node_config" yaml:"node_config"`
}

func (*NodeConfigUpdated) Kind

func (e *NodeConfigUpdated) Kind() string

type NodeDataUpdated

type NodeDataUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string    `json:"node" yaml:"node"`
	Value      node.Node `json:"node_data" yaml:"node_data"`
}

func (*NodeDataUpdated) Kind

func (e *NodeDataUpdated) Kind() string

type NodeFrozen

type NodeFrozen struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`

	// Status is true when frozen, else false
	Status bool `json:"is_frozen" yaml:"is_frozen"`

	// FrozenAt is the time when node has been frozen or zero when not frozen
	FrozenAt time.Time `json:"frozen_at" yaml:"frozen_at"`
}

NodeFrozen message describe a node frozen state update

func (*NodeFrozen) Kind

func (e *NodeFrozen) Kind() string

type NodeFrozenFileRemoved

type NodeFrozenFileRemoved struct {
	pubsub.Msg `yaml:",inline"`
	File       string `json:"file" yaml:"file"`
}

NodeFrozenFileRemoved is emitted by a fs watcher when a frozen file is removed from var. The nmon goroutine listens to this event and updates the daemondata, which in turns emits a NodeFrozen{} event.

func (*NodeFrozenFileRemoved) Kind

func (e *NodeFrozenFileRemoved) Kind() string

type NodeFrozenFileUpdated

type NodeFrozenFileUpdated struct {
	pubsub.Msg `yaml:",inline"`
	File       string    `json:"file" yaml:"file"`
	At         time.Time `json:"at" yaml:"at"`
}

NodeFrozenFileUpdated is emitted by a fs watcher when a frozen file is updated or created in var. The nmon goroutine listens to this event and updates the daemondata, which in turns emits a NodeFrozen{} event.

func (*NodeFrozenFileUpdated) Kind

func (e *NodeFrozenFileUpdated) Kind() string

type NodeMonitorDeleted

type NodeMonitorDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Node       string `json:"node" yaml:"node"`
}

func (*NodeMonitorDeleted) Kind

func (e *NodeMonitorDeleted) Kind() string

type NodeMonitorUpdated

type NodeMonitorUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string       `json:"node" yaml:"node"`
	Value      node.Monitor `json:"node_monitor" yaml:"node_monitor"`
}

func (*NodeMonitorUpdated) Kind

func (e *NodeMonitorUpdated) Kind() string

type NodeOsPathsUpdated

type NodeOsPathsUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string    `json:"node" yaml:"node"`
	Value      san.Paths `json:"san_paths" yaml:"san_paths"`
}

func (*NodeOsPathsUpdated) Kind

func (e *NodeOsPathsUpdated) Kind() string

type NodeRejoin

type NodeRejoin struct {
	pubsub.Msg     `yaml:",inline"`
	IsUpgrading    bool
	LastShutdownAt time.Time
	Nodes          []string
}

func (*NodeRejoin) Kind

func (e *NodeRejoin) Kind() string

type NodeSplitAction

type NodeSplitAction struct {
	pubsub.Msg      `yaml:",inline"`
	Node            string `json:"node" yaml:"node"`
	Action          string `json:"action" yaml:"action"`
	NodeVotes       int    `json:"node_votes" yaml:"node_votes"`
	ArbitratorVotes int    `json:"arbitrator_votes" yaml:"arbitrator_votes"`
	Voting          int    `json:"voting" yaml:"voting"`
	ProVoters       int    `json:"pro_voters" yaml:"pro_voters"`
}

func (*NodeSplitAction) Kind

func (e *NodeSplitAction) Kind() string

type NodeStatsUpdated

type NodeStatsUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string     `json:"node" yaml:"node"`
	Value      node.Stats `json:"node_stats" yaml:"node_stats"`
}

func (*NodeStatsUpdated) Kind

func (e *NodeStatsUpdated) Kind() string

type NodeStatusArbitratorsUpdated

type NodeStatusArbitratorsUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string                           `json:"node" yaml:"node"`
	Value      map[string]node.ArbitratorStatus `json:"arbitrator_status" yaml:"arbitrator_status"`
}

func (*NodeStatusArbitratorsUpdated) Kind

type NodeStatusGenUpdates

type NodeStatusGenUpdates struct {
	pubsub.Msg `yaml:",inline"`
	Node       string
	// Value is Node.Status.Gen
	Value map[string]uint64 `json:"gens" yaml:"gens"`
}

NodeStatusGenUpdates is emitted when then hb message gens are changed

func (*NodeStatusGenUpdates) Kind

func (e *NodeStatusGenUpdates) Kind() string

type NodeStatusLabelsUpdated

type NodeStatusLabelsUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string      `json:"node" yaml:"node"`
	Value      node.Labels `json:"node_labels" yaml:"node_labels"`
}

func (*NodeStatusLabelsUpdated) Kind

func (e *NodeStatusLabelsUpdated) Kind() string

type NodeStatusUpdated

type NodeStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string      `json:"node" yaml:"node"`
	Value      node.Status `json:"node_status" yaml:"node_status"`
}

NodeStatusUpdated is the message that nmon publish when node status is modified. The Value.Gen may be outdated, daemondata has the most recent version of gen.

func (*NodeStatusUpdated) Kind

func (e *NodeStatusUpdated) Kind() string

type ObjectCreated

type ObjectCreated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

ObjectCreated is the message published when a new object is detected by localhost.

func (*ObjectCreated) Kind

func (e *ObjectCreated) Kind() string

type ObjectDeleted

type ObjectDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

ObjectDeleted is the message published when an object deletetion is detected by localhost.

func (*ObjectDeleted) Kind

func (e *ObjectDeleted) Kind() string

type ObjectOrchestrationEnd

type ObjectOrchestrationEnd struct {
	pubsub.Msg `yaml:",inline"`
	ID         string      `json:"id" yaml:"id"`
	Node       string      `json:"node" yaml:"node"`
	Path       naming.Path `json:"path" yaml:"path"`
}

func (*ObjectOrchestrationEnd) Kind

func (e *ObjectOrchestrationEnd) Kind() string

type ObjectOrchestrationRefused

type ObjectOrchestrationRefused struct {
	pubsub.Msg `yaml:",inline"`
	ID         string      `json:"id" yaml:"id"`
	Node       string      `json:"node" yaml:"node"`
	Path       naming.Path `json:"path" yaml:"path"`
	Reason     string      `json:"reason" yaml:"reason"`
}

func (*ObjectOrchestrationRefused) Kind

type ObjectStatusDeleted

type ObjectStatusDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
}

func (*ObjectStatusDeleted) Kind

func (e *ObjectStatusDeleted) Kind() string

type ObjectStatusDone

type ObjectStatusDone struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
}

func (*ObjectStatusDone) Kind

func (e *ObjectStatusDone) Kind() string

type ObjectStatusUpdated

type ObjectStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path   `json:"path" yaml:"path"`
	Node       string        `json:"node" yaml:"node"`
	Value      object.Status `json:"object_status" yaml:"object_status"`
	SrcEv      any           `json:"source_event" yaml:"source_event"`
}

func (*ObjectStatusUpdated) Kind

func (e *ObjectStatusUpdated) Kind() string

func (*ObjectStatusUpdated) String

func (e *ObjectStatusUpdated) String() string

type ProgressInstanceMonitor

type ProgressInstanceMonitor struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path           `json:"path" yaml:"path"`
	Node       string                `json:"node" yaml:"node"`
	State      instance.MonitorState `json:"instance_monitor_state" yaml:"instance_monitor_state"`
	SessionID  uuid.UUID             `json:"session_id" yaml:"session_id"`
	IsPartial  bool                  `json:"is_partial" yaml:"is_partial"`
}

func (*ProgressInstanceMonitor) Kind

func (e *ProgressInstanceMonitor) Kind() string

type RemoteFileConfig

type RemoteFileConfig struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path     `json:"path" yaml:"path"`
	Node       string          `json:"node" yaml:"node"`
	File       string          `json:"file" yaml:"file"`
	Freeze     bool            `json:"freeze" yaml:"freeze"`
	UpdatedAt  time.Time       `json:"updated_at" yaml:"updated_at"`
	Ctx        context.Context `json:"-" yaml:"-"`
	Err        chan error      `json:"-" yaml:"-"`
}

func (*RemoteFileConfig) Kind

func (e *RemoteFileConfig) Kind() string

type SetInstanceMonitor

type SetInstanceMonitor struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path               `json:"path" yaml:"path"`
	Node       string                    `json:"node" yaml:"node"`
	Value      instance.MonitorUpdate    `json:"instance_monitor_update" yaml:"instance_monitor_update"`
	Err        errcontext.ErrCloseSender `json:"-" yaml:"-"`
}

func NewSetInstanceMonitorWithErr

func NewSetInstanceMonitorWithErr(ctx context.Context, p naming.Path, nodename string, value instance.MonitorUpdate) (*SetInstanceMonitor, errcontext.ErrReceiver)

func (*SetInstanceMonitor) Kind

func (e *SetInstanceMonitor) Kind() string

type SetInstanceMonitorRefused

type SetInstanceMonitorRefused struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path            `json:"path" yaml:"path"`
	Node       string                 `json:"node" yaml:"node"`
	Value      instance.MonitorUpdate `json:"instance_monitor_update" yaml:"instance_monitor_update"`
}

func (*SetInstanceMonitorRefused) Kind

type SetNodeMonitor

type SetNodeMonitor struct {
	pubsub.Msg `yaml:",inline"`
	Node       string                    `json:"node" yaml:"node"`
	Value      node.MonitorUpdate        `json:"node_monitor_update" yaml:"node_monitor_update"`
	Err        errcontext.ErrCloseSender `json:"-" yaml:"-"`
}

func NewSetNodeMonitorWithErr

func NewSetNodeMonitorWithErr(ctx context.Context, nodename string, value node.MonitorUpdate) (*SetNodeMonitor, errcontext.ErrReceiver)

func (*SetNodeMonitor) Kind

func (e *SetNodeMonitor) Kind() string

type WatchDog

type WatchDog struct {
	pubsub.Msg `yaml:",inline"`
	Bus        string `json:"bus" yaml:"bus"`
}

func (*WatchDog) Kind

func (e *WatchDog) Kind() string

func (*WatchDog) String

func (e *WatchDog) String() string

type ZoneRecordDeleted

type ZoneRecordDeleted struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
	Name       string      `json:"name" yaml:"name"`
	Type       string      `json:"type" yaml:"type"`
	TTL        int         `json:"ttl" yaml:"ttl"`
	Content    string      `json:"content" yaml:"content"`
}

func (*ZoneRecordDeleted) Kind

func (e *ZoneRecordDeleted) Kind() string

type ZoneRecordUpdated

type ZoneRecordUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Path       naming.Path `json:"path" yaml:"path"`
	Node       string      `json:"node" yaml:"node"`
	Name       string      `json:"name" yaml:"name"`
	Type       string      `json:"type" yaml:"type"`
	TTL        int         `json:"ttl" yaml:"ttl"`
	Content    string      `json:"content" yaml:"content"`
}

func (*ZoneRecordUpdated) Kind

func (e *ZoneRecordUpdated) Kind() string

Jump to

Keyboard shortcuts

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