ctrlc

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

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:"help='Filter on endpoint or service name',default=''"`
	Service      string `kong:"help='Filter on service name',default=''"`
	ShowInactive bool   `kong:"help='Include inactive nodes',default='false'"`
	Format       string `kong:"help='Output format',enum='tree,plain,json,namevalue',default='tree'"`
}

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 {
	ShowAll bool `kong:"help='Show all (ie incl failed, dead and left nodes)'"`
}

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.ClientParameters `kong:"embed"`
	Commands CommandList                 `kong:"embed"`
}

Parameters is the main parameter struct for the ctrlc utility

func (*Parameters) ClientParams added in v0.0.26

func (p *Parameters) ClientParams() clientfunk.ClientParameters

ClientParams returns the cluster client parameters

func (*Parameters) ClusterCommands

func (p *Parameters) ClusterCommands() CommandList

ClusterCommands returns the list of commands for the management utility

type RunContext

type RunContext interface {
	ClientParams() clientfunk.ClientParameters
	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

Jump to

Keyboard shortcuts

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