netconf

package
v0.0.0-...-2f4518d Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: BSD-2-Clause-Views Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCError

type RPCError struct {
	Type     string `xml:"error-type"`
	Tag      string `xml:"error-tag"`
	Severity string `xml:"error-severity"`
	Path     string `xml:"error-path"`
	Message  string `xml:"error-message"`
	Info     string `xml:",innerxml"`
}

RPCError defines an error reply to a RPC request

func (*RPCError) Error

func (re *RPCError) Error() string

Error generates a string representation of the provided RPC error

type RPCMessage

type RPCMessage struct {
	MessageID string
	Methods   []RPCMethod
}

RPCMessage represents an RPC Message to be sent.

func NewRPCMessage

func NewRPCMessage(methods []RPCMethod) *RPCMessage

NewRPCMessage generates a new RPC Message structure with the provided methods

func (*RPCMessage) MarshalXML

func (m *RPCMessage) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML marshals the NETCONF XML data

type RPCMethod

type RPCMethod interface {
	MarshalMethod() string
}

RPCMethod defines the interface for creating an RPC method.

type RPCReply

type RPCReply struct {
	XMLName  xml.Name   `xml:"rpc-reply"`
	Errors   []RPCError `xml:"rpc-error,omitempty"`
	Data     string     `xml:",innerxml"`
	Ok       bool       `xml:",omitempty"`
	RawReply string     `xml:"-"`
}

RPCReply defines a reply to a RPC request

func NewRPCReply

func NewRPCReply(rawXML []byte, ErrOnWarning bool) (*RPCReply, error)

NewRPCReply creates a new RPC Reply

type RawMethod

type RawMethod string

RawMethod defines how a raw text request will be responded to

func MethodGetConfig

func MethodGetConfig(source string) RawMethod

MethodGetConfig files a NETCONF get-config source request with the remote host

func MethodLock

func MethodLock(target string) RawMethod

MethodLock files a NETCONF lock target request with the remote host

func MethodUnlock

func MethodUnlock(target string) RawMethod

MethodUnlock files a NETCONF unlock target request with the remote host

func (RawMethod) MarshalMethod

func (r RawMethod) MarshalMethod() string

MarshalMethod converts the method's output into a string

Jump to

Keyboard shortcuts

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