cmds

package
v0.31.44 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid command, check arguments")

Functions

func Fprint

func Fprint(w io.Writer, a ...interface{})

Fprintf is fmt.Fprintf but it allows writer to be nil. Note! it throws an error.

func Fprintf

func Fprintf(w io.Writer, format string, a ...interface{})

Fprintf is fmt.Fprintf but it allows writer to be nil. Note! it throws an error.

func Fprintln

func Fprintln(w io.Writer, a ...interface{})

Fprintln is fmt.Fprintln but it allows writer to be nil. Note! it throws an error.

func Progress

func Progress(w io.Writer) chan<- struct{}

func ValidateKey

func ValidateKey(k string, name string) error

func ValidateSeed

func ValidateSeed(seed string) error

func ValidateTime

func ValidateTime(t string) error

Types

type Cmd

type Cmd struct {
	WalletName string `cmd_usage:"wallet name is required"`
	WalletKey  string `cmd_usage:"wallet key is required"`
}

func NewCmd

func NewCmd(d []byte) (c *Cmd, err error)

func (Cmd) Validate

func (c Cmd) Validate() error

func (Cmd) ValidateWalletExistence

func (c Cmd) ValidateWalletExistence(should bool) error

func (Cmd) ValidateWalletKey

func (c Cmd) ValidateWalletKey() error

type Command

type Command interface {
	Validate() error
	Exec(w io.Writer) (r Result, err error)
	RPCExec(w io.Writer) (r Result, err error)
}

type Edge

type Edge struct {
	Cmd
	*cloud.Agent
}

type GrpcCmd

type GrpcCmd struct {
	TLSPath string
	Addr    string
	Port    int
	AdminID string
}

func (GrpcCmd) Validate

func (c GrpcCmd) Validate() error

type Result

type Result interface {
	JSON() ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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