Documentation ¶
Index ¶
- Constants
- Variables
- func Api(s *Server) node.Node
- func NewChunkedRdr(in io.Reader) <-chan io.Reader
- func NewChunkedWtr(w io.Writer) io.WriteCloser
- func WriteResponse(response any, out io.Writer) error
- func WriteResponseWithOptions(response any, out io.Writer, includeMessageDelim bool, pretty bool) error
- type CreateSubscription
- type HelloMsg
- type Msg
- type MsgLeaf
- type NamedStreams
- type Notification
- type Request
- type RpcCopy
- type RpcData
- type RpcEdit
- type RpcFilter
- type RpcGet
- type RpcMsg
- type RpcReply
- type RpcSource
- type Server
- type Session
- type SessionManager
- type SshHandler
- type SshOptions
- type SshStatus
Constants ¶
View Source
const (
Base_1_1 = "urn:ietf:params:netconf:base:1.1"
)
Variables ¶
View Source
var ErrEOS = errors.New("end of session") // not really an error but linter wants "Err" prefix
ErrEOS signals the session should be closed gracefully.
View Source
var ErrInvalidLogin = errors.New("invalid login")
Functions ¶
func NewChunkedRdr ¶
NewChunkedRdr reads "chunked" xml messages according to RFC6242 so that individual xml messages can be sent over a ssh stream.
see https://datatracker.ietf.org/doc/html/rfc6242#section-4.1
Chunked message framing example where xxx is replaced with NETCONF messages:
#4 xxxx #12 xxxxxxxxxxxx ## This has 2 chunks of sizes 4 and 12 bytes.
func NewChunkedWtr ¶
func NewChunkedWtr(w io.Writer) io.WriteCloser
NewChunkedWtr is the counterpart to NewMsgsRdr
Types ¶
type CreateSubscription ¶
type NamedStreams ¶
type Notification ¶
type Request ¶
func (*Request) UnmarshalXML ¶
type RpcEdit ¶
type RpcEdit struct { Target *Msg `xml:"target,omitempty"` // allowed: merge(default), replace, create, delete, remove DefaultOperation string `xml:"default-operation,omitempty"` // allowed: test-then-set(default), set, test-only TestOperation *Msg `xml:"test-operation,omitempty"` // allowed: stop-on-error(default), continue-on-error, rollback-on-error ErrorOption *Msg `xml:"error-option,omitempty"` Config *nodeutil.XmlNode `xml:"config"` Elem *Msg `xml:",any"` }
type RpcFilter ¶
type RpcFilter struct { Type string `xml:"type,attr"` // when Type is "xpath" Select string `xml:"select,omitempty"` Elems []*Msg `xml:",any"` // contains filtered or unexported fields }
func (*RpcFilter) CompileXPath ¶
func (*RpcFilter) UnmarshalXML ¶
type RpcMsg ¶
type RpcMsg struct { XMLName xml.Name `xml:"urn:ietf:params:xml:ns:netconf:base:1.0 rpc"` MessageId string `xml:"message-id,attr"` Attrs []xml.Attr `xml:",any,attr"` GetConfig *RpcGet `xml:"get-config,omitempty"` Get *RpcGet `xml:"get,omitempty"` EditConfig *RpcEdit `xml:"edit-config,omitempty"` Copy *RpcCopy `xml:"copy-config,omitempty"` Delete *RpcEdit `xml:"delete-config,omitempty"` Close *Msg `xml:"close-session,omitempty"` Kill *Msg `xml:"kill-session,omitempty"` CreateSubscription *CreateSubscription `xml:"create-subscription,omitempty"` Action *nodeutil.XmlNode `xml:",any"` }
type Server ¶
type Server struct { Ver string // contains filtered or unexported fields }
func (*Server) NextSessionId ¶
func (*Server) StreamService ¶
type Session ¶
type Session struct { Id int64 // contains filtered or unexported fields }
func NewSession ¶
type SessionManager ¶
type SshHandler ¶
func NewSshHandler ¶
func NewSshHandler(h SessionManager, dev device.Device) *SshHandler
func (*SshHandler) Apply ¶
func (s *SshHandler) Apply(opts SshOptions) error
func (*SshHandler) Options ¶
func (s *SshHandler) Options() SshOptions
func (*SshHandler) Status ¶
func (s *SshHandler) Status() SshStatus
type SshOptions ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.