command

package
v0.0.0-...-43c0f45 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DEBUG = false
View Source
const N95MaxSamples = 16 * 1024 * 1024

Variables

This section is empty.

Functions

func GetFactory

func GetFactory() *factory

func RunCommand

func RunCommand(f Command, in []Input, out Output) error

A method for preparing all the bytes and pieces to pass along to the next step.

Types

type Argument

type Argument struct {
	Name      string
	ShortName string
	Usage     string
	Type      Flag
}

type ArgumentCollection

type ArgumentCollection struct {
	Booleans map[string]bool
	Integers map[string]int
	Strings  map[string]string
}

func MakeCommandArgumentCollection

func MakeCommandArgumentCollection(index int, args map[string]interface{}, cmd Definition) (ArgumentCollection, error)

type Command

type Command interface {
	Finish(int, commandTarget) error
	Prepare(string, int, ArgumentCollection) error
	Run(int, commandTarget, commandSource, commandError) error
	Terminate(commandTarget) error
}

type Definition

type Definition struct {
	Usage string
	Flags []Argument
}

type Flag

type Flag int
const (
	Bool Flag = iota
	Int
	IntSourceSlice
	String
	StringSourceSlice
)

type Input

type Input struct {
	Arguments ArgumentCollection
	Name      string
	Length    int64
	Reader    source.Factory
}

type Output

type Output struct {
	Writer io.WriteCloser
	Error  io.WriteCloser
}

Jump to

Keyboard shortcuts

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