Documentation ¶
Index ¶
- Variables
- type HelloMessage
- type ReadWriteCloser
- type Transport
- type TransportBasicIO
- func (t *TransportBasicIO) Close() error
- func (t *TransportBasicIO) Receive() ([]byte, error)
- func (t *TransportBasicIO) ReceiveHello() (*HelloMessage, error)
- func (t *TransportBasicIO) Send(data []byte) error
- func (t *TransportBasicIO) SendHello(hello *HelloMessage) error
- func (t *TransportBasicIO) WaitForBytes(b []byte) ([]byte, error)
- func (t *TransportBasicIO) WaitForFunc(f func([]byte) (int, error)) ([]byte, error)
- func (t *TransportBasicIO) WaitForRegexp(re *regexp.Regexp) ([]byte, [][]byte, error)
- func (t *TransportBasicIO) WaitForString(s string) (string, error)
- func (t *TransportBasicIO) Writeln(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
var DefaultCapabilities = []string{
"urn:ietf:params:netconf:base:1.0",
}
DefaultCapabilities sets the default capabilities of the client library
Functions ¶
This section is empty.
Types ¶
type HelloMessage ¶
type HelloMessage struct { XMLName xml.Name `xml:"urn:ietf:params:xml:ns:netconf:base:1.0 hello"` Capabilities []string `xml:"capabilities>capability"` SessionID int `xml:"session-id,omitempty"` }
HelloMessage is used when bringing up a NETCONF session
type ReadWriteCloser ¶
type ReadWriteCloser struct { io.Reader io.WriteCloser }
ReadWriteCloser represents a combined IO Reader and WriteCloser
func NewReadWriteCloser ¶
func NewReadWriteCloser(r io.Reader, w io.WriteCloser) *ReadWriteCloser
NewReadWriteCloser creates a new combined IO Reader and Write Closer from the provided objects
type Transport ¶
type Transport interface { Send([]byte) error Receive() ([]byte, error) Close() error ReceiveHello() (*HelloMessage, error) SendHello(*HelloMessage) error }
Transport interface defines what characteristics make up a NETCONF transport layer object.
type TransportBasicIO ¶
type TransportBasicIO struct { io.ReadWriteCloser // contains filtered or unexported fields }
TransportBasicIO is the type for dealing with transportIO which implements Transport
func (*TransportBasicIO) Receive ¶
func (t *TransportBasicIO) Receive() ([]byte, error)
Receive data over transport
func (*TransportBasicIO) ReceiveHello ¶
func (t *TransportBasicIO) ReceiveHello() (*HelloMessage, error)
ReceiveHello over transport
func (*TransportBasicIO) Send ¶
func (t *TransportBasicIO) Send(data []byte) error
Send a well formated NETCONF rpc message as a slice of bytes adding on the necessary framing messages.
func (*TransportBasicIO) SendHello ¶
func (t *TransportBasicIO) SendHello(hello *HelloMessage) error
SendHello over transport
func (*TransportBasicIO) WaitForBytes ¶
func (t *TransportBasicIO) WaitForBytes(b []byte) ([]byte, error)
WaitForBytes over transport
func (*TransportBasicIO) WaitForFunc ¶
WaitForFunc over transport
func (*TransportBasicIO) WaitForRegexp ¶
WaitForRegexp over transport
func (*TransportBasicIO) WaitForString ¶
func (t *TransportBasicIO) WaitForString(s string) (string, error)
WaitForString over transport