msgbus

package
v3.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package msgbus defines the Opensvc messages

HOWTO Add a new msgX:

- daemon/msgbus/messages.go Add the msgX type - daemon/msgbus/messages.go Add the kindToT["msgX"] mapping - daemon/msgbus/messages.go Add the `Kind() string` implementation - daemon/msgbus/messages.go Add the `Key() string` implementation to activate the diff event renderer - core/commoncmd/text/node-events/flag/filter Document msgX

msgX is waitable (om node events --filter msgX --wait)

- daemon/msgbus/event_cache.go add a event cache feeder

msgX is exposed in the daemon data:

- daemon/msgbus/xxx.go create the ClusterData.onMsgX function - daemon/msgbus/main.go update the ClusterData.ApplyMessage function

msgX must be sent to peers (to patch):

- daemon/daemondata/data.go update the startSubscriptions function - daemon/daemondata/data.go update the localEventMustBeForwarded function

msgX is received from peer (from patch):

- daemon/daemondata/apply_patch.go update the setCacheAndPublish function:

"full" is received from peer, which contains a msgX data

- daemon/daemondata/apply_full.go update the applyNodeData function

on peer node delete, we may need to publish msgX delete events

- daemon/daemondata/node_data.go update data.dropPeer function

Note:

  • 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

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

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) Key

func (e *ClusterConfigUpdated) Key() string

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) ExtractEvents

func (data *ClusterData) ExtractEvents(m any, labels pubsub.Labels) ([]any, error)

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) Key

func (e *DaemonCollectorUpdated) Key() string

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) Key

func (e *DaemonDnsUpdated) Key() string

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:"heartbeat" yaml:"heartbeat"`
}

func (*DaemonHeartbeatUpdated) Key

func (e *DaemonHeartbeatUpdated) Key() string

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) Key

func (e *DaemonListenerUpdated) Key() string

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) Key

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) Key

func (e *DaemonSchedulerUpdated) Key() string

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) Key

func (e *DaemonStatusUpdated) Key() string

func (*DaemonStatusUpdated) Kind

func (e *DaemonStatusUpdated) Kind() string

type EnterOverloadPeriod

type EnterOverloadPeriod struct {
	pubsub.Msg `yaml:",inline"`
}

func (*EnterOverloadPeriod) Kind

func (e *EnterOverloadPeriod) 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"`
	RequesterSessionID uuid.UUID `json:"requester_session_id" yaml:"requester_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"`
	RequesterSessionID uuid.UUID `json:"requester_session_id" yaml:"requester_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"`
	RequesterSessionID uuid.UUID `json:"requester_session_id" yaml:"requester_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

type HeartbeatAlive

type HeartbeatAlive 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 (*HeartbeatAlive) Kind

func (e *HeartbeatAlive) Kind() string

type HeartbeatMessageTypeUpdated

type HeartbeatMessageTypeUpdated 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 node.Gen `json:"installed_gens" yaml:"installed_gens"`
}

func (*HeartbeatMessageTypeUpdated) Key

func (*HeartbeatMessageTypeUpdated) Kind

type HeartbeatRotateError

type HeartbeatRotateError struct {
	pubsub.Msg `yaml:",inline"`
	ID         uuid.UUID `json:"id" yaml:"id"`
	Reason     string    `json:"reason" yaml:"reason"`
}

func (*HeartbeatRotateError) Kind

func (e *HeartbeatRotateError) Kind() string

type HeartbeatRotateRequest

type HeartbeatRotateRequest struct {
	pubsub.Msg `yaml:",inline"`
	ID         uuid.UUID `json:"id" yaml:"id"`
}

func (*HeartbeatRotateRequest) Kind

func (e *HeartbeatRotateRequest) Kind() string

type HeartbeatRotateSuccess

type HeartbeatRotateSuccess struct {
	pubsub.Msg `yaml:",inline"`
	ID         uuid.UUID `json:"id" yaml:"id"`
}

func (*HeartbeatRotateSuccess) Kind

func (e *HeartbeatRotateSuccess) Kind() string

type HeartbeatSecretUpdated

type HeartbeatSecretUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Nodename   string          `json:"nodename" yaml:"nodename"`
	Value      hbsecret.Secret `json:"hb_secret" yaml:"hb_secret"`
}

func (*HeartbeatSecretUpdated) Kind

func (e *HeartbeatSecretUpdated) Kind() string

type HeartbeatStale

type HeartbeatStale 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 (*HeartbeatStale) Kind

func (e *HeartbeatStale) 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) KeysToDelete

func (e *InstanceConfigDeleted) KeysToDelete() []string

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) Key

func (e *InstanceConfigUpdated) Key() string

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"`
	OrchestrationEnd *ObjectOrchestrationEnd `json:"orchestration_end" yaml:"orchestration_end"`
}

func (*InstanceMonitorDeleted) KeysToDelete

func (e *InstanceMonitorDeleted) KeysToDelete() []string

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) Key

func (e *InstanceMonitorUpdated) Key() string

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"`
	PeerDropAt time.Time   `json:"peer_drop_at"`
}

func (*InstanceStatusDeleted) KeysToDelete

func (e *InstanceStatusDeleted) KeysToDelete() []string

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) Key

func (e *InstanceStatusUpdated) Key() string

func (*InstanceStatusUpdated) Kind

func (e *InstanceStatusUpdated) Kind() string

type JoinError

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

func (*JoinError) Kind

func (e *JoinError) Kind() string

type JoinIgnored

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

func (*JoinIgnored) Kind

func (e *JoinIgnored) Kind() string

type JoinRequest

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

func (*JoinRequest) Kind

func (e *JoinRequest) Kind() string

type JoinSuccess

type JoinSuccess struct {
	pubsub.Msg `yaml:",inline"`
	// AddedNode is a node that has been successfully added to the cluster config nodes
	// after join request or sysadmin cluster config nodes update.
	AddedNode string `json:"added_node" yaml:"added_node"`
}

func (*JoinSuccess) Kind

func (e *JoinSuccess) Kind() string

type Keyer

type Keyer interface {
	Key() string
}

type LeaveError

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

func (*LeaveError) Kind

func (e *LeaveError) Kind() string

type LeaveIgnored

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

func (*LeaveIgnored) Kind

func (e *LeaveIgnored) Kind() string

type LeaveOverloadPeriod

type LeaveOverloadPeriod struct {
	pubsub.Msg `yaml:",inline"`
}

func (*LeaveOverloadPeriod) Kind

func (e *LeaveOverloadPeriod) Kind() string

type LeaveRequest

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

func (*LeaveRequest) Kind

func (e *LeaveRequest) Kind() string

type LeaveSuccess

type LeaveSuccess struct {
	pubsub.Msg `yaml:",inline"`
	// RemovedNode is the successfully removed node from cluster config nodes
	RemovedNode string `json:"removed_node" yaml:"removed_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 NodeAlive

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

func (*NodeAlive) Kind

func (e *NodeAlive) 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) Key

func (e *NodeConfigUpdated) Key() string

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) Key

func (e *NodeDataUpdated) Key() string

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) KeysToDelete

func (e *NodeMonitorDeleted) KeysToDelete() []string

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) Key

func (e *NodeMonitorUpdated) Key() string

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) Key

func (e *NodeOsPathsUpdated) Key() string

func (*NodeOsPathsUpdated) Kind

func (e *NodeOsPathsUpdated) Kind() string

type NodePoolStatusDeleted

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

func (*NodePoolStatusDeleted) Kind

func (e *NodePoolStatusDeleted) Kind() string

type NodePoolStatusUpdated

type NodePoolStatusUpdated struct {
	pubsub.Msg `yaml:",inline"`
	Node       string      `json:"node" yaml:"node"`
	Name       string      `json:"name" yaml:"name"`
	Value      pool.Status `json:"pool_status" yaml:"pool_status"`
}

func (*NodePoolStatusUpdated) Key

func (e *NodePoolStatusUpdated) Key() string

func (*NodePoolStatusUpdated) Kind

func (e *NodePoolStatusUpdated) 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 NodeStale

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

func (*NodeStale) Kind

func (e *NodeStale) 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) Key

func (e *NodeStatsUpdated) Key() string

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) Key

func (*NodeStatusArbitratorsUpdated) Kind

type NodeStatusGenUpdates

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

NodeStatusGenUpdates is emitted when then hb message gens are changed

func (*NodeStatusGenUpdates) Key

func (e *NodeStatusGenUpdates) Key() string

func (*NodeStatusGenUpdates) Kind

func (e *NodeStatusGenUpdates) Kind() string

type NodeStatusLabelsCommited

type NodeStatusLabelsCommited struct {
	pubsub.Msg `yaml:",inline"`
	Node       string  `json:"node" yaml:"node"`
	Value      label.M `json:"node_labels" yaml:"node_labels"`
}

func (*NodeStatusLabelsCommited) Kind

func (e *NodeStatusLabelsCommited) Kind() string

type NodeStatusLabelsUpdated

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

func (*NodeStatusLabelsUpdated) Key

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) Key

func (e *NodeStatusUpdated) Key() string

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 deletion is detected by localhost.

func (*ObjectDeleted) Kind

func (e *ObjectDeleted) Kind() string

type ObjectOrchestrationAccepted

type ObjectOrchestrationAccepted struct {
	pubsub.Msg            `yaml:",inline"`
	ID                    string                       `json:"id" yaml:"id"`
	Node                  string                       `json:"node" yaml:"node"`
	Path                  naming.Path                  `json:"path" yaml:"path"`
	GlobalExpect          instance.MonitorGlobalExpect `json:"global_expect" yaml:"global_expect"`
	GlobalExpectUpdatedAt time.Time                    `json:"global_expect_updated_at" yaml:"global_expect_updated_at"`
}

func (*ObjectOrchestrationAccepted) Kind

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"`
	GlobalExpect          instance.MonitorGlobalExpect `json:"global_expect" yaml:"global_expect"`
	GlobalExpectUpdatedAt time.Time                    `json:"global_expect_updated_at" yaml:"global_expect_updated_at"`
	Aborted               bool                         `json:"aborted" yaml:"aborted"`
}

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"`
	GlobalExpect *instance.MonitorGlobalExpect `json:"global_expect" yaml:"global_expect"`
}

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) KeysToDelete

func (e *ObjectStatusDeleted) KeysToDelete() []string

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) Key

func (e *ObjectStatusUpdated) Key() string

func (*ObjectStatusUpdated) Kind

func (e *ObjectStatusUpdated) Kind() 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 RunFileRemoved

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

RunFileRemoved is emitted by the fs_watcher when it detects a resource run file is deleted in <var>.

func (*RunFileRemoved) Kind

func (e *RunFileRemoved) Kind() string

type RunFileUpdated

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

RunFileUpdated is emitted by the fs_watcher when it detects a new or initial resource run file in <var>.

func (*RunFileUpdated) Kind

func (e *RunFileUpdated) 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

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) KeysToDelete

func (e *ZoneRecordDeleted) KeysToDelete() []string

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) Key

func (e *ZoneRecordUpdated) Key() string

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