framing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package framing offers RFC6242 end-of-message and chunked framing decoders.

The functions in this package return bufio.SplitFunc for use with a *bufio.Scanner. These functions will return io.ErrUnexpectedEOF when input terminates other than at the end of a message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitChunked

func SplitChunked(endOfMessage func()) bufio.SplitFunc

SplitChunked returns a bufio.SplitFunc suitable for decoding "chunked framing" NETCONF transport streams.

endOfMessage will be called at the end of each NETCONF message.

It must only be used with bufio.Scanner who have a buffer of at least 16 bytes.

func SplitEOM

func SplitEOM(endOfMessage func()) bufio.SplitFunc

SplitEOM returns a bufio.SplitFunc suitable for RFC6242 "end-of-message delimited" NETCONF transport streams.

endOfMessage will be called at the end of each NETCONF message.

Types

type ErrBadChunk

type ErrBadChunk struct {
	Message string
	Offset  int
}

func (ErrBadChunk) Error

func (e ErrBadChunk) Error() string

Jump to

Keyboard shortcuts

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