protocol

package
v0.0.0-...-1974178 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Events

type Events struct {
	// Holds event instances to attach to for received messages.
	// Use a message's ID to get the corresponding event.
	Received []*events.Event
	// Fired for generic protocol errors.
	Error *events.Event
}

Events holds protocol related events.

type Protocol

type Protocol struct {
	// Holds events for sent/received messages and generic errors.
	Events Events
	// contains filtered or unexported fields
}

Protocol encapsulates the logic of parsing and sending protocol messages.

func New

func New(r *message.Registry) *Protocol

New generates a new protocol instance which is ready to read a first message header.

func (*Protocol) Read

func (p *Protocol) Read(data []byte) (int, error)

Read acts as an event handler for received data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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