command

package
v0.0.0-...-a841890 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2015 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Command fields
	COMMAND_FIELD = iota
	IP_FIELD
	INTERVAL_FIELD
	DEADLINE_FIELD
	OUT_FILE_FIELD
	USER_NAME_FIELD
	PASSWORD_FIELD
	NUM_FIELDS
)
View Source
const (
	// Available commands
	CHASSIS_ENV_CMD = "show chassis environment"
)
View Source
const (
	CHASSIS_ENV_CMD_TMPL = "<get-environment-information></get-environment-information>"
)

Variables

View Source
var (
	FieldNameMap map[int]string
)

Functions

This section is empty.

Types

type ChassisEnvCmd

type ChassisEnvCmd struct {
	// NETCONF credentials
	UserName string
	Password string

	// Where to execute the command
	LoopBackIP net.IP

	// The interval to execute the command
	Interval time.Duration
	// The deadline to stop executing the command
	Deadline time.Duration
	// contains filtered or unexported fields
}

func ChassisEnvCmdFromRecord

func ChassisEnvCmdFromRecord(record []string) (*ChassisEnvCmd, error)

func (*ChassisEnvCmd) Cancel

func (cer *ChassisEnvCmd) Cancel()

func (*ChassisEnvCmd) Method

func (*ChassisEnvCmd) Method() netconf.RawMethod

func (*ChassisEnvCmd) OutFile

func (cer *ChassisEnvCmd) OutFile() (*os.File, error)

func (*ChassisEnvCmd) Run

func (cer *ChassisEnvCmd) Run() (<-chan *netconf.RPCReply, <-chan error)

type Commander

type Commander interface {
	Run() (<-chan *netconf.RPCReply, <-chan error)
	OutFile() (*os.File, error)
	Cancel()
}

type Error

type Error struct {
	Method    string `json:"method,omitempty" xml:"method,omitempty"`
	ClientErr string `json:"error,omitempty"  xml:"error,omitempty"`
	Err       error  `json:"-"                xml:"-"`
}

func (Error) Error

func (cerr Error) Error() string

type ParseError

type ParseError struct {
	Method      string   `json:"method,omitempty" xml:"method,omitempty"`
	ClientErr   string   `json:"error,omitempty"  xml:"error,omitempty"`
	RecordNum   int      `json:"record-number"    xml:"record-number"`
	RecordField int      `json:"record-field"     xml:"record-field"`
	Record      []string `json:"parsed-record"    xml:"parsed-record"`
	Err         error    `json:"-"                xml:"-"`
}

func (ParseError) Error

func (cpe ParseError) Error() string

type RunError

type RunError struct {
	Method    string `json:"method,omitempty" xml:"method,omitempty"`
	ClientErr string `json:"error,omitempty"  xml:"error,omitempty"`
	Err       error  `json:"-"                xml:"-"`
	Cmd       Commander
}

func (RunError) Error

func (cre RunError) Error() string

Jump to

Keyboard shortcuts

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