Documentation
¶
Overview ¶
Package frame provides a framed reader and writer.
Message frames are prefixed with a 4-byte big-endian encoded integer holding the length of the rest of the frame.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client provides bidirectional outgoing framed communication.
It allows sending framed requests where each request has a corresponding response. Only one active request is allowed at a time. Other requests are blocked while a request is ongoing.
type Handler ¶
type Handler interface { // Receives the given framed request and responds to it. Handle([]byte) ([]byte, error) }
Handler handles incoming framed requests.
type Reader ¶
Reader is a reader for framed messages.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides bidirectional incoming framed communication.
It allows receiving framed requests and responding to them.
func NewServer ¶
NewServer builds a new server which reads requests from the given Reader and writes responses to the given Writer.