netconf

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package netconf implements netconf.

Index

Constants

View Source
const AuxServerCapabilities = "NetconfServerCapabilities"

Variables

This section is empty.

Functions

func BindDeviceOpts

func BindDeviceOpts(fn func(connection streamer.Connector, opts ...DeviceOption) device.Device, opts ...DeviceOption) func(connection streamer.Connector) device.Device

func NewDevice

func NewDevice(connection streamer.Connector, opts ...DeviceOption) device.Device

Types

type Capabilities

type Capabilities struct {
	XMLName      xml.Name `xml:"capabilities"`
	Capabilities []string `xml:"capability"`
}

type Data

type Data struct {
	XMLName xml.Name `xml:"data"`
	Content []byte   `xml:",innerxml"`
	Nodes   []Node   `xml:",any"`
}

type DeviceOption

type DeviceOption func(*NetconfDevice)

func WithCapabilities

func WithCapabilities(caps []string) DeviceOption

func WithLogger

func WithLogger(l *zap.Logger) DeviceOption

type Hello

type Hello struct {
	XMLName   xml.Name     `xml:"hello"`
	Xmlns     string       `xml:"xmlns,attr"`
	Hello     Capabilities `xml:"capabilities"`
	SessionID string       `xml:"session-id,omitempty"`
}

type NetconfDevice

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

func (*NetconfDevice) Close

func (m *NetconfDevice) Close()

func (*NetconfDevice) Connect

func (m *NetconfDevice) Connect(ctx context.Context) (err error)

func (*NetconfDevice) Download

func (m *NetconfDevice) Download(paths []string) (map[string]streamer.File, error)

func (*NetconfDevice) Execute

func (m *NetconfDevice) Execute(command gcmd.Cmd) (gcmd.CmdRes, error)

func (*NetconfDevice) GetAux

func (m *NetconfDevice) GetAux() map[string]any

func (*NetconfDevice) GetServerCapabilities

func (m *NetconfDevice) GetServerCapabilities() []string

func (*NetconfDevice) Upload

func (m *NetconfDevice) Upload(paths map[string]streamer.File) error

type Node

type Node struct {
	XMLName xml.Name
	Content []byte `xml:",innerxml"`
	Nodes   []Node `xml:",any"`
}

type RPCError

type RPCError struct {
	XMLName       xml.Name `xml:"rpc-error"`
	ErrorType     string   `xml:"error-type"`
	ErrorTag      string   `xml:"error-tag"`
	ErrorSeverity string   `xml:"error-severity"`
	ErrorPath     string   `xml:"error-path"`
	ErrorMessage  string   `xml:"error-message"`
}

type RPCReply

type RPCReply struct {
	XMLName   xml.Name `xml:"rpc-reply"`
	RPCError  RPCError `xml:"rpc-error"`
	Data      Data     `xml:"data"`
	MessageID string   `xml:"message-id,attr"`
	Content   []byte   `xml:",innerxml"`
	Nodes     []Node   `xml:",any"`
}

Jump to

Keyboard shortcuts

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