cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendCommand added in v0.6.0

type AppendCommand struct {
	Source string
	Target string
	Mode   AppendMode
	// contains filtered or unexported fields
}

AppendCommand container for all 'append' parameters

func NewAppendCommand added in v0.6.0

func NewAppendCommand(c *client.Client) *AppendCommand

NewAppendCommand creates a new AppendCommand parameter container

func (*AppendCommand) GetName added in v0.6.0

func (cmd *AppendCommand) GetName() string

GetName returns the AppendCommand's name identifier

func (*AppendCommand) IsSane added in v0.6.0

func (cmd *AppendCommand) IsSane() bool

IsSane returns true if command is sane

func (*AppendCommand) Parse added in v0.6.0

func (cmd *AppendCommand) Parse(args []string) error

Parse parses the arguments and returns true on success; otherwise it prints usage and returns false

func (*AppendCommand) PrintUsage added in v0.7.1

func (cmd *AppendCommand) PrintUsage()

PrintUsage print command usage

func (*AppendCommand) Run added in v0.6.0

func (cmd *AppendCommand) Run() int

Run executes 'append' with given AppendCommand's parameters

type AppendMode added in v0.6.0

type AppendMode string

AppendMode defines behaviour in case existing secrets are in conflict

const (
	// ModeSkip do not append secret on conflict
	ModeSkip AppendMode = "skip"
	// ModeOverwrite overwrite existing secret on conflict
	ModeOverwrite AppendMode = "overwrite"
	// ModeRename keep existing secret and create a new key on conflict
	ModeRename AppendMode = "rename"
	// ModeInvalid denotes invalid mode
	ModeInvalid AppendMode = "invalid"
)

type CatCommand

type CatCommand struct {
	Path string
	// contains filtered or unexported fields
}

CatCommand container for all 'cat' parameters

func NewCatCommand

func NewCatCommand(c *client.Client) *CatCommand

NewCatCommand creates a new CatCommand parameter container

func (*CatCommand) GetName

func (cmd *CatCommand) GetName() string

GetName returns the CatCommand's name identifier

func (*CatCommand) IsSane added in v0.1.1

func (cmd *CatCommand) IsSane() bool

IsSane returns true if command is sane

func (*CatCommand) Parse added in v0.1.1

func (cmd *CatCommand) Parse(args []string) error

Parse given arguments and return status

func (*CatCommand) PrintUsage added in v0.7.1

func (cmd *CatCommand) PrintUsage()

PrintUsage print command usage

func (*CatCommand) Run

func (cmd *CatCommand) Run() int

Run executes 'cat' with given CatCommand's parameters

type CdCommand

type CdCommand struct {
	Path string
	// contains filtered or unexported fields
}

CdCommand container for all 'cd' parameters

func NewCdCommand

func NewCdCommand(c *client.Client) *CdCommand

NewCdCommand creates a new CdCommand parameter container

func (*CdCommand) GetName

func (cmd *CdCommand) GetName() string

GetName returns the CdCommand's name identifier

func (*CdCommand) IsSane added in v0.1.1

func (cmd *CdCommand) IsSane() bool

IsSane returns true if command is sane

func (*CdCommand) Parse added in v0.1.1

func (cmd *CdCommand) Parse(args []string) error

Parse given arguments and return status

func (*CdCommand) PrintUsage added in v0.7.1

func (cmd *CdCommand) PrintUsage()

PrintUsage print command usage

func (*CdCommand) Run

func (cmd *CdCommand) Run() int

Run executes 'cd' with given CdCommand's parameters

type Command

type Command interface {
	Run() int
	GetName() string
	IsSane() bool
	PrintUsage()
	Parse(args []string) error
}

Command interface to describe a command structure

type Commands added in v0.7.2

type Commands struct {
	Mv     *MoveCommand
	Cp     *CopyCommand
	Append *AppendCommand
	Rm     *RemoveCommand
	Ls     *ListCommand
	Cd     *CdCommand
	Cat    *CatCommand
	Grep   *GrepCommand
}

Commands contains all available commands

func NewCommands added in v0.7.2

func NewCommands(client *client.Client) *Commands

NewCommands returns a Commands struct with all available commands

type CopyCommand

type CopyCommand struct {
	Source string
	Target string
	// contains filtered or unexported fields
}

CopyCommand container for all 'cp' parameters

func NewCopyCommand

func NewCopyCommand(c *client.Client) *CopyCommand

NewCopyCommand creates a new CopyCommand parameter container

func (*CopyCommand) GetName

func (cmd *CopyCommand) GetName() string

GetName returns the CopyCommand's name identifier

func (*CopyCommand) IsSane added in v0.1.1

func (cmd *CopyCommand) IsSane() bool

IsSane returns true if command is sane

func (*CopyCommand) Parse added in v0.1.1

func (cmd *CopyCommand) Parse(args []string) error

Parse given arguments and return status

func (*CopyCommand) PrintUsage added in v0.7.1

func (cmd *CopyCommand) PrintUsage()

PrintUsage print command usage

func (*CopyCommand) Run

func (cmd *CopyCommand) Run() int

Run executes 'cp' with given CopyCommand's parameters

type GrepCommand added in v0.5.0

type GrepCommand struct {
	Path   string
	Search string
	Regexp *regexp.Regexp
	// contains filtered or unexported fields
}

GrepCommand container for all 'grep' parameters

func NewGrepCommand added in v0.5.0

func NewGrepCommand(c *client.Client, stdout io.Writer, stderr io.Writer) *GrepCommand

NewGrepCommand creates a new GrepCommand parameter container

func (*GrepCommand) GetName added in v0.5.0

func (cmd *GrepCommand) GetName() string

GetName returns the GrepCommand's name identifier

func (*GrepCommand) IsSane added in v0.5.0

func (cmd *GrepCommand) IsSane() bool

IsSane returns true if command is sane

func (*GrepCommand) Parse added in v0.5.0

func (cmd *GrepCommand) Parse(args []string) error

Parse given arguments and return status

func (*GrepCommand) PrintUsage added in v0.7.1

func (cmd *GrepCommand) PrintUsage()

PrintUsage print command usage

func (*GrepCommand) Run added in v0.5.0

func (cmd *GrepCommand) Run() int

Run executes 'grep' with given RemoveCommand's parameters

type ListCommand

type ListCommand struct {
	Path string
	// contains filtered or unexported fields
}

ListCommand container for 'ls' parameters

func NewListCommand

func NewListCommand(c *client.Client) *ListCommand

NewListCommand creates a new ListCommand parameter container

func (*ListCommand) GetName

func (cmd *ListCommand) GetName() string

GetName returns the ListCommand's name identifier

func (*ListCommand) IsSane added in v0.1.1

func (cmd *ListCommand) IsSane() bool

IsSane returns true if command is sane

func (*ListCommand) Parse added in v0.1.1

func (cmd *ListCommand) Parse(args []string) error

Parse given arguments and return status

func (*ListCommand) PrintUsage added in v0.7.1

func (cmd *ListCommand) PrintUsage()

PrintUsage print command usage

func (*ListCommand) Run

func (cmd *ListCommand) Run() int

Run executes 'ls' with given ListCommand's parameters

type Match added in v0.5.0

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

Match structure to keep indices of matched terms

type MoveCommand

type MoveCommand struct {
	Source string
	Target string
	// contains filtered or unexported fields
}

MoveCommand container for all 'mv' parameters

func NewMoveCommand

func NewMoveCommand(c *client.Client) *MoveCommand

NewMoveCommand creates a new MoveCommand parameter container

func (*MoveCommand) GetName

func (cmd *MoveCommand) GetName() string

GetName returns the MoveCommand's name identifier

func (*MoveCommand) IsSane added in v0.1.1

func (cmd *MoveCommand) IsSane() bool

IsSane returns true if command is sane

func (*MoveCommand) Parse added in v0.1.1

func (cmd *MoveCommand) Parse(args []string) error

Parse given arguments and return status

func (*MoveCommand) PrintUsage added in v0.7.1

func (cmd *MoveCommand) PrintUsage()

PrintUsage print command usage

func (*MoveCommand) Run

func (cmd *MoveCommand) Run() int

Run executes 'mv' with given MoveCommand's parameters

type RemoveCommand

type RemoveCommand struct {
	Path string
	// contains filtered or unexported fields
}

RemoveCommand container for all 'rm' parameters

func NewRemoveCommand

func NewRemoveCommand(c *client.Client) *RemoveCommand

NewRemoveCommand creates a new RemoveCommand parameter container

func (*RemoveCommand) GetName

func (cmd *RemoveCommand) GetName() string

GetName returns the RemoveCommand's name identifier

func (*RemoveCommand) IsSane added in v0.1.1

func (cmd *RemoveCommand) IsSane() bool

IsSane returns true if command is sane

func (*RemoveCommand) Parse added in v0.1.1

func (cmd *RemoveCommand) Parse(args []string) error

Parse given arguments and return status

func (*RemoveCommand) PrintUsage added in v0.7.1

func (cmd *RemoveCommand) PrintUsage()

PrintUsage print command usage

func (*RemoveCommand) Run

func (cmd *RemoveCommand) Run() int

Run executes 'rm' with given RemoveCommand's parameters

Jump to

Keyboard shortcuts

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