command

package
v0.0.0-...-e9719be Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0, MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPAddrFlag

func HTTPAddrFlag(f *flag.FlagSet) *string

HTTPAddrFlag returns a pointer to a string that will be populated when the given flagset is parsed with the HTTP address of the Consul.

func HTTPClient

func HTTPClient(addr string) (*consulapi.Client, error)

HTTPClient returns a new Consul HTTP client with the given address.

func HTTPClientConfig

func HTTPClientConfig(fn func(c *consulapi.Config)) (*consulapi.Client, error)

HTTPClientConfig is used to return a new API client and modify its configuration by passing in a config modifier function.

func RPCAddrFlag

func RPCAddrFlag(f *flag.FlagSet) *string

RPCAddrFlag returns a pointer to a string that will be populated when the given flagset is parsed with the RPC address of the Consul.

func RPCClient

func RPCClient(addr string) (*agent.RPCClient, error)

RPCClient returns a new Consul RPC client with the given address.

Types

type ByMemberName

type ByMemberName []agent.Member

so we can sort members by name

func (ByMemberName) Len

func (m ByMemberName) Len() int

func (ByMemberName) Less

func (m ByMemberName) Less(i, j int) bool

func (ByMemberName) Swap

func (m ByMemberName) Swap(i, j int)

type ConfigTestCommand

type ConfigTestCommand struct {
	Ui cli.Ui
}

ConfigTestCommand is a Command implementation that is used to verify config files

func (*ConfigTestCommand) Help

func (c *ConfigTestCommand) Help() string

func (*ConfigTestCommand) Run

func (c *ConfigTestCommand) Run(args []string) int

func (*ConfigTestCommand) Synopsis

func (c *ConfigTestCommand) Synopsis() string

type EventCommand

type EventCommand struct {
	Ui cli.Ui
}

EventCommand is a Command implementation that is used to fire new events

func (*EventCommand) Help

func (c *EventCommand) Help() string

func (*EventCommand) Run

func (c *EventCommand) Run(args []string) int

func (*EventCommand) Synopsis

func (c *EventCommand) Synopsis() string

type ExecCommand

type ExecCommand struct {
	ShutdownCh <-chan struct{}
	Ui         cli.Ui
	// contains filtered or unexported fields
}

ExecCommand is a Command implementation that is used to do remote execution of commands

func (*ExecCommand) Help

func (c *ExecCommand) Help() string

func (*ExecCommand) Run

func (c *ExecCommand) Run(args []string) int

func (*ExecCommand) Synopsis

func (c *ExecCommand) Synopsis() string

type ForceLeaveCommand

type ForceLeaveCommand struct {
	Ui cli.Ui
}

ForceLeaveCommand is a Command implementation that tells a running Consul to force a member to enter the "left" state.

func (*ForceLeaveCommand) Help

func (c *ForceLeaveCommand) Help() string

func (*ForceLeaveCommand) Run

func (c *ForceLeaveCommand) Run(args []string) int

func (*ForceLeaveCommand) Synopsis

func (c *ForceLeaveCommand) Synopsis() string

type InfoCommand

type InfoCommand struct {
	Ui cli.Ui
}

InfoCommand is a Command implementation that queries a running Consul agent for various debugging statistics for operators

func (*InfoCommand) Help

func (i *InfoCommand) Help() string

func (*InfoCommand) Run

func (i *InfoCommand) Run(args []string) int

func (*InfoCommand) Synopsis

func (i *InfoCommand) Synopsis() string

type JoinCommand

type JoinCommand struct {
	Ui cli.Ui
}

JoinCommand is a Command implementation that tells a running Consul agent to join another.

func (*JoinCommand) Help

func (c *JoinCommand) Help() string

func (*JoinCommand) Run

func (c *JoinCommand) Run(args []string) int

func (*JoinCommand) Synopsis

func (c *JoinCommand) Synopsis() string

type KVCommand

type KVCommand struct {
	Ui cli.Ui
}

KVCommand is a Command implementation that just shows help for the subcommands nested below it.

func (*KVCommand) Help

func (c *KVCommand) Help() string

func (*KVCommand) Run

func (c *KVCommand) Run(args []string) int

func (*KVCommand) Synopsis

func (c *KVCommand) Synopsis() string

type KVDeleteCommand

type KVDeleteCommand struct {
	Ui cli.Ui
}

KVDeleteCommand is a Command implementation that is used to delete a key or prefix of keys from the key-value store.

func (*KVDeleteCommand) Help

func (c *KVDeleteCommand) Help() string

func (*KVDeleteCommand) Run

func (c *KVDeleteCommand) Run(args []string) int

func (*KVDeleteCommand) Synopsis

func (c *KVDeleteCommand) Synopsis() string

type KVGetCommand

type KVGetCommand struct {
	Ui cli.Ui
}

KVGetCommand is a Command implementation that is used to fetch the value of a key from the key-value store.

func (*KVGetCommand) Help

func (c *KVGetCommand) Help() string

func (*KVGetCommand) Run

func (c *KVGetCommand) Run(args []string) int

func (*KVGetCommand) Synopsis

func (c *KVGetCommand) Synopsis() string

type KVPutCommand

type KVPutCommand struct {
	Ui cli.Ui
	// contains filtered or unexported fields
}

KVPutCommand is a Command implementation that is used to write data to the key-value store.

func (*KVPutCommand) Help

func (c *KVPutCommand) Help() string

func (*KVPutCommand) Run

func (c *KVPutCommand) Run(args []string) int

func (*KVPutCommand) Synopsis

func (c *KVPutCommand) Synopsis() string

type KeygenCommand

type KeygenCommand struct {
	Ui cli.Ui
}

KeygenCommand is a Command implementation that generates an encryption key for use in `consul agent`.

func (*KeygenCommand) Help

func (c *KeygenCommand) Help() string

func (*KeygenCommand) Run

func (c *KeygenCommand) Run(_ []string) int

func (*KeygenCommand) Synopsis

func (c *KeygenCommand) Synopsis() string

type KeyringCommand

type KeyringCommand struct {
	Ui cli.Ui
}

KeyringCommand is a Command implementation that handles querying, installing, and removing gossip encryption keys from a keyring.

func (*KeyringCommand) Help

func (c *KeyringCommand) Help() string

func (*KeyringCommand) Run

func (c *KeyringCommand) Run(args []string) int

func (*KeyringCommand) Synopsis

func (c *KeyringCommand) Synopsis() string

type LeaveCommand

type LeaveCommand struct {
	Ui cli.Ui
}

LeaveCommand is a Command implementation that instructs the Consul agent to gracefully leave the cluster

func (*LeaveCommand) Help

func (c *LeaveCommand) Help() string

func (*LeaveCommand) Run

func (c *LeaveCommand) Run(args []string) int

func (*LeaveCommand) Synopsis

func (c *LeaveCommand) Synopsis() string

type LockCommand

type LockCommand struct {
	ShutdownCh <-chan struct{}
	Ui         cli.Ui
	// contains filtered or unexported fields
}

LockCommand is a Command implementation that is used to setup a "lock" which manages lock acquisition and invokes a sub-process

func (*LockCommand) Help

func (c *LockCommand) Help() string

func (*LockCommand) Run

func (c *LockCommand) Run(args []string) int

func (*LockCommand) Synopsis

func (c *LockCommand) Synopsis() string

type LockUnlock

type LockUnlock struct {
	// contains filtered or unexported fields
}

LockUnlock is used to abstract over the differences between a lock and a semaphore.

type MaintCommand

type MaintCommand struct {
	Ui cli.Ui
}

MaintCommand is a Command implementation that enables or disables node or service maintenance mode.

func (*MaintCommand) Help

func (c *MaintCommand) Help() string

func (*MaintCommand) Run

func (c *MaintCommand) Run(args []string) int

func (*MaintCommand) Synopsis

func (c *MaintCommand) Synopsis() string

type MembersCommand

type MembersCommand struct {
	Ui cli.Ui
}

MembersCommand is a Command implementation that queries a running Consul agent what members are part of the cluster currently.

func (*MembersCommand) Help

func (c *MembersCommand) Help() string

func (*MembersCommand) Run

func (c *MembersCommand) Run(args []string) int

func (*MembersCommand) Synopsis

func (c *MembersCommand) Synopsis() string

type MonitorCommand

type MonitorCommand struct {
	ShutdownCh <-chan struct{}
	Ui         cli.Ui
	// contains filtered or unexported fields
}

MonitorCommand is a Command implementation that queries a running Consul agent what members are part of the cluster currently.

func (*MonitorCommand) Help

func (c *MonitorCommand) Help() string

func (*MonitorCommand) Run

func (c *MonitorCommand) Run(args []string) int

func (*MonitorCommand) Synopsis

func (c *MonitorCommand) Synopsis() string

type OperatorCommand

type OperatorCommand struct {
	Ui cli.Ui
}

OperatorCommand is used to provide various low-level tools for Consul operators.

func (*OperatorCommand) Help

func (c *OperatorCommand) Help() string

func (*OperatorCommand) Run

func (c *OperatorCommand) Run(args []string) int

func (*OperatorCommand) Synopsis

func (c *OperatorCommand) Synopsis() string

Synopsis returns a one-line description of this command.

type RTTCommand

type RTTCommand struct {
	Ui cli.Ui
}

RTTCommand is a Command implementation that allows users to query the estimated round trip time between nodes using network coordinates.

func (*RTTCommand) Help

func (c *RTTCommand) Help() string

func (*RTTCommand) Run

func (c *RTTCommand) Run(args []string) int

func (*RTTCommand) Synopsis

func (c *RTTCommand) Synopsis() string

type ReloadCommand

type ReloadCommand struct {
	Ui cli.Ui
}

ReloadCommand is a Command implementation that instructs the Consul agent to reload configurations

func (*ReloadCommand) Help

func (c *ReloadCommand) Help() string

func (*ReloadCommand) Run

func (c *ReloadCommand) Run(args []string) int

func (*ReloadCommand) Synopsis

func (c *ReloadCommand) Synopsis() string

type SnapshotCommand

type SnapshotCommand struct {
	Ui cli.Ui
}

SnapshotCommand is a Command implementation that just shows help for the subcommands nested below it.

func (*SnapshotCommand) Help

func (c *SnapshotCommand) Help() string

func (*SnapshotCommand) Run

func (c *SnapshotCommand) Run(args []string) int

func (*SnapshotCommand) Synopsis

func (c *SnapshotCommand) Synopsis() string

type SnapshotInspectCommand

type SnapshotInspectCommand struct {
	Ui cli.Ui
}

SnapshotInspectCommand is a Command implementation that is used to display metadata about a snapshot file

func (*SnapshotInspectCommand) Help

func (c *SnapshotInspectCommand) Help() string

func (*SnapshotInspectCommand) Run

func (c *SnapshotInspectCommand) Run(args []string) int

func (*SnapshotInspectCommand) Synopsis

func (c *SnapshotInspectCommand) Synopsis() string

type SnapshotRestoreCommand

type SnapshotRestoreCommand struct {
	Ui cli.Ui
}

SnapshotRestoreCommand is a Command implementation that is used to restore the state of the Consul servers for disaster recovery.

func (*SnapshotRestoreCommand) Help

func (c *SnapshotRestoreCommand) Help() string

func (*SnapshotRestoreCommand) Run

func (c *SnapshotRestoreCommand) Run(args []string) int

func (*SnapshotRestoreCommand) Synopsis

func (c *SnapshotRestoreCommand) Synopsis() string

type SnapshotSaveCommand

type SnapshotSaveCommand struct {
	Ui cli.Ui
}

SnapshotSaveCommand is a Command implementation that is used to save the state of the Consul servers for disaster recovery.

func (*SnapshotSaveCommand) Help

func (c *SnapshotSaveCommand) Help() string

func (*SnapshotSaveCommand) Run

func (c *SnapshotSaveCommand) Run(args []string) int

func (*SnapshotSaveCommand) Synopsis

func (c *SnapshotSaveCommand) Synopsis() string

type TargetedUi

type TargetedUi struct {
	Target string
	Ui     cli.Ui
}

TargetedUi is a UI that wraps another UI implementation and modifies the output to indicate a specific target. Specifically, all Say output is prefixed with the target name. Message output is not prefixed but is offset by the length of the target so that output is lined up properly with Say output. Machine-readable output has the proper target set.

func (*TargetedUi) Ask

func (u *TargetedUi) Ask(query string) (string, error)

func (*TargetedUi) Error

func (u *TargetedUi) Error(message string)

func (*TargetedUi) Info

func (u *TargetedUi) Info(message string)

func (*TargetedUi) Output

func (u *TargetedUi) Output(message string)

type VersionCommand

type VersionCommand struct {
	HumanVersion string
	Ui           cli.Ui
}

VersionCommand is a Command implementation prints the version.

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

func (*VersionCommand) Run

func (c *VersionCommand) Run(_ []string) int

func (*VersionCommand) Synopsis

func (c *VersionCommand) Synopsis() string

type WatchCommand

type WatchCommand struct {
	ShutdownCh <-chan struct{}
	Ui         cli.Ui
}

WatchCommand is a Command implementation that is used to setup a "watch" which uses a sub-process

func (*WatchCommand) Help

func (c *WatchCommand) Help() string

func (*WatchCommand) Run

func (c *WatchCommand) Run(args []string) int

func (*WatchCommand) Synopsis

func (c *WatchCommand) Synopsis() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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