Documentation
¶
Overview ¶
Package ctrlc contains commands for the Clusterfunk CLI. The commands uses the Kong library for annotations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandList ¶
type CommandList struct { Status StatusCommand `kong:"cmd,help='Show the node status'"` Nodes ListNodesCommand `kong:"cmd,help='List the nodes in the cluster'"` Endpoints EndpointsCommand `kong:"cmd,help='List endpoints known by the node'"` Node NodeCommand `kong:"cmd,help='Add and remove nodes in cluster'"` Shards ShardsCommand `kong:"cmd,help='Show the shards in the cluster'"` StepDown StepDownCommand `kong:"cmd,help='Step down as the current leader'"` Diag DiagnosticsCommand `kong:"cmd,help='Show diagnostic information for zeroconf, serf and raft'"` }
CommandList contains all of the commands for the ctrlc utility
type DiagnosticsCommand ¶
type DiagnosticsCommand struct { }
DiagnosticsCommand is a command to show cluster diagnostics
func (*DiagnosticsCommand) Run ¶
func (c *DiagnosticsCommand) Run(args RunContext) error
Run executes the diagnostic command
type EndpointsCommand ¶
type EndpointsCommand struct {
Filter string `kong:"optional,arg,help='Filter on prefix'"`
}
EndpointsCommand is the subcommand to list endpoints
func (*EndpointsCommand) Run ¶
func (c *EndpointsCommand) Run(args RunContext) error
Run executes the endpoint command
type ListNodesCommand ¶
type ListNodesCommand struct { }
ListNodesCommand is the subcommand to list nodes in the cluster
func (*ListNodesCommand) Run ¶
func (c *ListNodesCommand) Run(args RunContext) error
Run executes the list nodes command
type NodeCommand ¶
type NodeCommand struct { Add addNodeCommand `kong:"cmd,help='Add node to cluster'"` Rm removeNodeCommand `kong:"cmd,help='Remove node from cluster'"` ID string `kong:"required,help='Node ID',short='N'"` }
NodeCommand is the subcommand to add and remove nodes
type Parameters ¶
type Parameters struct { Server clientfunk.ManagementServerParameters `kong:"embed"` Commands CommandList `kong:"embed"` }
Parameters is the main parameter struct for the ctrlc utility
func (*Parameters) ClusterCommands ¶
func (p *Parameters) ClusterCommands() CommandList
ClusterCommands returns the list of commands for the management utility
func (*Parameters) ClusterServer ¶
func (p *Parameters) ClusterServer() clientfunk.ManagementServerParameters
ClusterServer returns the management server parameters
type RunContext ¶
type RunContext interface { ClusterServer() clientfunk.ManagementServerParameters ClusterCommands() CommandList }
RunContext is the context passed on to the subcommands. Override this when reusing the commands in other projects.
type ShardsCommand ¶
type ShardsCommand struct { }
ShardsCommand is the subcommand that shows the shards in the cluster
func (*ShardsCommand) Run ¶
func (c *ShardsCommand) Run(args RunContext) error
Run shows the current shard distribution in the cluster
type StatusCommand ¶
type StatusCommand struct { }
StatusCommand is a subcommand for the ctrlc CLI.
func (*StatusCommand) Run ¶
func (c *StatusCommand) Run(args RunContext) error
Run executes the status operation
type StepDownCommand ¶
type StepDownCommand struct { }
StepDownCommand is the step-down subcommand. The current leader will step down and let another node assume leadership.
func (*StepDownCommand) Run ¶
func (c *StepDownCommand) Run(args RunContext) error
Run executes the step-down command on the node