cmd

package
Version: v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayHelp

func DisplayHelp(vi VersionInfo)

DisplayHelp shows the main help text

func ProcessCommands

func ProcessCommands(args []string, vi VersionInfo) error

ProcessCommands takes the command line arguments and starts the processing according to the above defined commands

Types

type BootstrapCommand

type BootstrapCommand struct {
	CommandDefaults
	// contains filtered or unexported fields
}

BootstrapCommand struct

func NewBootstrapCommand

func NewBootstrapCommand() *BootstrapCommand

NewBootstrapCommand creates the Bootstrap Command

func (*BootstrapCommand) Init

func (g *BootstrapCommand) Init(args []string) error

Init sets up the command struct from arguments

func (*BootstrapCommand) Name

func (g *BootstrapCommand) Name() string

Name returns the name of the command

func (*BootstrapCommand) Run

func (g *BootstrapCommand) Run() error

Run runs the command by creating the wireguard interface, starting the serf cluster and grpc server

type CommandDefaults

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

CommandDefaults struct defines a FlagSet and shared flags for all commands

func NewCommandDefaults

func NewCommandDefaults() CommandDefaults

NewCommandDefaults returns the defaults

func (*CommandDefaults) DefaultFields

func (c *CommandDefaults) DefaultFields(fs *flag.FlagSet)

DefaultFields handles default fields in given flag set

func (*CommandDefaults) ProcessDefaults

func (c *CommandDefaults) ProcessDefaults()

ProcessDefaults sets logging and other defaults

type InfoCommand

type InfoCommand struct {
	CommandDefaults
	// contains filtered or unexported fields
}

InfoCommand struct

func NewInfoCommand

func NewInfoCommand() *InfoCommand

NewInfoCommand creates the Info Command structure and sets the parameters

func (*InfoCommand) Init

func (g *InfoCommand) Init(args []string) error

Init sets up the command struct from arguments

func (*InfoCommand) Name

func (g *InfoCommand) Name() string

Name returns the name of the command

func (*InfoCommand) Run

func (g *InfoCommand) Run() error

Run queries the agent for Info info

type JoinCommand

type JoinCommand struct {
	CommandDefaults
	// contains filtered or unexported fields
}

JoinCommand struct

func NewJoinCommand

func NewJoinCommand() *JoinCommand

NewJoinCommand creates the Join Command

func (*JoinCommand) Init

func (g *JoinCommand) Init(args []string) error

Init sets up the command struct from arguments

func (*JoinCommand) Name

func (g *JoinCommand) Name() string

Name returns the name of the command

func (*JoinCommand) Run

func (g *JoinCommand) Run() error

Run runs the command by creating the wireguard interface, starting the serf cluster and grpc server

type RTTCommand

type RTTCommand struct {
	CommandDefaults
	// contains filtered or unexported fields
}

RTTCommand struct

func NewRTTCommand

func NewRTTCommand() *RTTCommand

NewRTTCommand creates the Tag Command

func (*RTTCommand) Init

func (g *RTTCommand) Init(args []string) error

Init sets up the command struct from arguments

func (*RTTCommand) Name

func (g *RTTCommand) Name() string

Name returns the name of the command

func (*RTTCommand) Run

func (g *RTTCommand) Run() error

Run queries the agent for RTT info

type Runner

type Runner interface {
	Init([]string) error
	Run() error
	Name() string
}

Runner is able to execute a single command

type TagsCommand

type TagsCommand struct {
	CommandDefaults
	// contains filtered or unexported fields
}

TagsCommand struct

func NewTagsCommand

func NewTagsCommand() *TagsCommand

NewTagsCommand creates the Tag Command

func (*TagsCommand) Init

func (g *TagsCommand) Init(args []string) error

Init sets up the command struct from arguments

func (*TagsCommand) Name

func (g *TagsCommand) Name() string

Name returns the name of the command

func (*TagsCommand) Run

func (g *TagsCommand) Run() error

Run runs the command by creating the wireguard interface, starting the serf cluster and grpc server

type UICommand added in v0.1.2

type UICommand struct {
	CommandDefaults
	// contains filtered or unexported fields
}

UICommand struct

func NewUICommand added in v0.1.2

func NewUICommand() *UICommand

NewUICommand creates the UI Command structure and sets the parameters

func (*UICommand) Init added in v0.1.2

func (g *UICommand) Init(args []string) error

Init sets up the command struct from arguments

func (*UICommand) Name added in v0.1.2

func (g *UICommand) Name() string

Name returns the name of the command

func (*UICommand) Run added in v0.1.2

func (g *UICommand) Run() error

Run starts an http server to serve the user interface

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
}

VersionInfo captures version information injected by the build process

Jump to

Keyboard shortcuts

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