transport

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	HeaderPath      = "path"
	HeaderError     = "error"
	HeaderRequestID = "reqid"
)

Variables

View Source
var ErrHeaderTooLong = errors.New("header is longer than 255 characters")
View Source
var ErrTooManyHeaders = errors.New("too many headers")

Functions

This section is empty.

Types

type Listener

type Listener interface {
	Close() error
	Accept(ctx context.Context, fn func(Socket)) error
}

type Message

type Message struct {
	Headers map[string]string
	Data    []byte
}

func NewMessage

func NewMessage() *Message

func (*Message) GetError added in v1.2.1

func (m *Message) GetError() (err error, hasError bool)

func (*Message) SetError

func (m *Message) SetError(err error)

type Socket

type Socket interface {
	Close() error
	Send(ctx context.Context, msg *Message) error
	Receive(ctx context.Context, msg *Message) error
}

type Transport

type Transport interface {
	Listen(ctx context.Context, addr string) (Listener, error)
	Dial(ctx context.Context, addr string) (Socket, error)
}

Jump to

Keyboard shortcuts

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