Documentation ¶
Overview ¶
Package message provides the NETCONF message layer.
A Session uses the Splitter type along with Reader and Writer to provide per-message io.Reader and io.WriteCloser objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEndOfStream = errors.New("end of stream")
ErrEndOfStream indicates the transport stream has ended. This is somewhat equivalent to io.EOF, in that it indicates no more data can be read from the underlying transport due to an EOF on said transport.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
Decoder is a NETCONF message reader, implementing io.ReadCloser.
D must point to an initialized *transport.Reader, while OnEOF must be a non-nil function, called at end of stream, when the underlying transport sees EOF.
type Encoder ¶
type Encoder struct { E *transport.Writer OnClosed func() // contains filtered or unexported fields }
Encoder is a NETCONF message encoder, implementing io.WriteCloser
type Splitter ¶
type Splitter struct { R *transport.Reader W *transport.Writer // contains filtered or unexported fields }
Splitter manages the NETCONF transport session for the message layer.
Its task is to split the session up into a series of NETCONF messages. A NETCONF message is a complete XML document. Normally, a single NETCONF message is followed by the transport end-of-message marker. If the session has negotiated pipelining support, multiple NETCONF messages (typically multiple <rpc> or <rpc-reply> elemenets) may be exchanged before the transport end-of-message marker is exchanged.
The Splitter provides access to the current message Decoder and Encoder. The Reader will return EOF when the end-of-message marker is received, while the Writer sends the end-of-message marker when closed.
func (*Splitter) FinishReader ¶
func (s *Splitter) FinishReader()
FinishReader emits a new reader on the next call(s) to Reader
func (*Splitter) FinishWriter ¶
func (s *Splitter) FinishWriter()
FinishWriter emits a new writer on the next call(s) to Writer