Documentation ¶
Overview ¶
Package transport provides the NETCONF transport layer.
The transport layer provides "clean" Reader and Writer interfaces to respectively decode and encode traffic for the underlying transport layer. The message layer reads and writes to these transport layer objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a NETCONF transport decoder offering an io.Reader interface.
NETCONF sessions exchange request/response and broadcast messages via the transport. Data sent on the wire is encoded according to the framing mode presently chosen; initially (and always, for :base:1.0 sessions), messages are sent verbatim and terminated by the end of message token. After the <hello> message, :base:1.1 sessions use a chunked framing mechanism with the same message semantics (see RFC6242, s4.2).
The Reader decodes data using the current framing protocol, making it available to users via the Read call.
func NewReader ¶
NewReader returns a new Reader given the source io.Reader and a function to be called after each message
func (*Reader) SetFramingMode ¶
SetFramingMode sets the NETCONF transport framing to end of message mode (chunked=false) or chunked framing mode (chunked=true).
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a RFC6242 NETCONF transport encoder, implementing io.WriteCloser.
A Writer takes a destination io.WriteCloser and encodes input appropriately, with a consistent API no matter the Encoder's current framing mode.
It supports both RFC4742 NETCONF 1.0 end-of-message framing as well as NETCONF 1.1 chunked framing.
func NewWriter ¶
func NewWriter(dst io.WriteCloser) *Writer
NewWriter returns a new RFC6242 Encoder (inline filter) writing to the destination dst. Encoder implements io.Writer.
func (*Writer) SetFramingMode ¶
SetFramingMode sets the framing mode of the Encoder. If chunked is true, chunked framing will be used, else end-of-message frming is used.