packet

package
v1.4.5-0...-9d41ec3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package packet is codec of packet for connection which supports framing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDecoder

func NewDecoder(r FrameReader) base.FrameReader

NewDecoder creates a packet decoder which reads from r.

func NewEncoder

func NewEncoder(w FrameWriter) base.FrameWriter

NewEncoder creates a packet encoder which writes to w.

Types

type FrameReader

type FrameReader interface {
	NextReader() (base.FrameType, io.ReadCloser, error)
}

FrameReader is the reader which supports framing.

type FrameWriter

type FrameWriter interface {
	NextWriter(typ base.FrameType) (io.WriteCloser, error)
}

FrameWriter is the writer which supports framing.

Jump to

Keyboard shortcuts

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