cmd

package
Version: v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cmd provides all the commands that spinc can run: start, status, etc.

Index

Constants

View Source
const (
	RECORD_SEPARATOR = "--\n"
)

Variables

View Source
var (
	ErrNotExist = errors.New("command does not exist")
)

Functions

func QuoteArgValue

func QuoteArgValue(val string) string

func SqueezeString

func SqueezeString(s string, n int, x string) string

SqueezeString makes string s fit into n characters by truncating and replacing middle characters with x. Example: "hello, world!" squeezed into 5 characters with ".." replacement: "he..!". Preference is given to left-side characters when the truncation is not even. If s is squeezed too hard, it returns an empty string (n - len(x) < 0 = "").

Types

type DefaultFactory

type DefaultFactory struct {
}

func (*DefaultFactory) Make

func (f *DefaultFactory) Make(name string, ctx app.Context) (app.Command, error)

type ErrUnknownArgs

type ErrUnknownArgs struct {
	Request string
	Args    []string
}

func (ErrUnknownArgs) Error

func (e ErrUnknownArgs) Error() string

type Help

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

func NewHelp

func NewHelp(ctx app.Context) *Help

func (*Help) Cmd

func (c *Help) Cmd() string

func (*Help) Help

func (c *Help) Help() string

func (*Help) Prepare

func (c *Help) Prepare() error

func (*Help) QuickHelp

func (c *Help) QuickHelp()

func (*Help) RequestHelp

func (c *Help) RequestHelp(reqName string) error

func (*Help) Run

func (c *Help) Run() error

func (*Help) Usage

func (c *Help) Usage()

type Info

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

func NewInfo

func NewInfo(ctx app.Context) *Info

func (*Info) Cmd

func (c *Info) Cmd() string

func (*Info) Help

func (c *Info) Help() string

func (*Info) Prepare

func (c *Info) Prepare() error

func (*Info) Run

func (c *Info) Run() error

type Log

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

func NewLog

func NewLog(ctx app.Context) *Log

func (*Log) Cmd

func (c *Log) Cmd() string

func (*Log) Help

func (c *Log) Help() string

func (*Log) Prepare

func (c *Log) Prepare() error

func (*Log) Run

func (c *Log) Run() error

type Ps

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

func NewPs

func NewPs(ctx app.Context) *Ps

func (*Ps) Cmd

func (c *Ps) Cmd() string

func (*Ps) Help

func (c *Ps) Help() string

func (*Ps) Prepare

func (c *Ps) Prepare() error

func (*Ps) Run

func (c *Ps) Run() error

type Running

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

func NewRunning

func NewRunning(ctx app.Context) *Running

func (*Running) Cmd

func (c *Running) Cmd() string

func (*Running) Help

func (c *Running) Help() string

func (*Running) Prepare

func (c *Running) Prepare() error

func (*Running) Run

func (c *Running) Run() error

type Start

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

func NewStart

func NewStart(ctx app.Context) *Start

func (*Start) Cmd

func (c *Start) Cmd() string

func (*Start) Help

func (c *Start) Help() string

func (*Start) Prepare

func (c *Start) Prepare() error

func (*Start) Run

func (c *Start) Run() error

type Status

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

func NewStatus

func NewStatus(ctx app.Context) *Status

func (*Status) Cmd

func (c *Status) Cmd() string

func (*Status) Help

func (c *Status) Help() string

func (*Status) Prepare

func (c *Status) Prepare() error

func (*Status) Run

func (c *Status) Run() error

type Stop

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

func NewStop

func NewStop(ctx app.Context) *Stop

func (*Stop) Cmd

func (c *Stop) Cmd() string

func (*Stop) Help

func (c *Stop) Help() string

func (*Stop) Prepare

func (c *Stop) Prepare() error

func (*Stop) Run

func (c *Stop) Run() error

type Version

type Version struct {
}

func NewVersion

func NewVersion(ctx app.Context) *Version

func (*Version) Cmd

func (c *Version) Cmd() string

func (*Version) Help

func (c *Version) Help() string

func (*Version) Prepare

func (c *Version) Prepare() error

func (*Version) Run

func (c *Version) Run() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL