device

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package device describes high-level interface for interaction with a device.

Index

Constants

This section is empty.

Variables

View Source
var ErrorStreamerNotSupportedByDevice = errors.New("unsupported streamer")

Functions

func ExecuteBulk

func ExecuteBulk(dev Device, commands []gcmd.Cmd) ([]gcmd.CmdRes, error)

func ThrowEchoReadException

func ThrowEchoReadException(lastRead []byte) error

func ThrowExecException

func ThrowExecException(data string) error

func ThrowQuestionException

func ThrowQuestionException(question []byte) error

Types

type Device

type Device interface {
	Connect(ctx context.Context) error
	Execute(command gcmd.Cmd) (gcmd.CmdRes, error)
	Download(paths []string) (map[string]streamer.File, error)
	Upload(paths map[string]streamer.File) error
	Close()
	GetAux() map[string]any
}

type EchoReadException

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

func (*EchoReadException) Error

func (e *EchoReadException) Error() string

type ExecException

type ExecException struct {
	Data string
}

func (*ExecException) Error

func (m *ExecException) Error() string

func (*ExecException) Is

func (m *ExecException) Is(target error) bool

type QuestionException

type QuestionException struct {
	Question []byte
}

func (*QuestionException) Error

func (e *QuestionException) Error() string

type SFTPSupport

type SFTPSupport interface {
	EnableSFTP()
}

Directories

Path Synopsis
Package cisco implements Cisco Catalyst CLI using genericcli.
Package cisco implements Cisco Catalyst CLI using genericcli.
Package genericcli implements Device interface using regular expressions.
Package genericcli implements Device interface using regular expressions.
Package huawei implements huawei CLI using genericcli.
Package huawei implements huawei CLI using genericcli.
Package juniper implements juniper CLI using genericcli.
Package juniper implements juniper CLI using genericcli.
Package netconf implements netconf.
Package netconf implements netconf.
Package nxos implements Cisco Nexus CLI using genericcli.
Package nxos implements Cisco Nexus CLI using genericcli.
Package pc implements upon generic SSH-server with ability to exec like Linux, macOS, etc.
Package pc implements upon generic SSH-server with ability to exec like Linux, macOS, etc.
Package ros implements RouterOS CLI using genericcli.
Package ros implements RouterOS CLI using genericcli.

Jump to

Keyboard shortcuts

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