parcel

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCodeInternalServer ErrorCode = 500
	ErrorCodeBadRequest               = 400
	ErrCodeNotFoundHandler            = 401
)

Variables

View Source
var (
	DefaultErrorPacket = NewErrorPacket(codec.DefaultCodec)
)

Functions

func Recycle

func Recycle(p ...*RocPacket)

Types

type ChannelHandler

type ChannelHandler func(c *context.Context, req chan *RocPacket, errs chan error) (chan proto.Message, chan error)

type ErrorCode

type ErrorCode = int32

type ErrorPackager

type ErrorPackager interface {
	Encode(code ErrorCode, err error) []byte
}

type ErrorPacket

type ErrorPacket struct {
	// contains filtered or unexported fields
}

func NewErrorPacket

func NewErrorPacket(cc codec.Codec) *ErrorPacket

func (*ErrorPacket) Encode

func (e *ErrorPacket) Encode(code ErrorCode, err error) []byte

type Fire

type Fire func(c *context.Context, req proto.Message) (proto.Message, error)

type Handler

type Handler func(c *context.Context, req *RocPacket, interrupt Interceptor) (rsp proto.Message, err error)

type Interceptor

type Interceptor func(c *context.Context, req proto.Message, fire Fire) (proto.Message, error)

type RocPacket

type RocPacket struct {
	B *bytes.Buffer
}

func NewPacket

func NewPacket() *RocPacket

func Payload

func Payload(b []byte) *RocPacket

func (*RocPacket) Bytes

func (r *RocPacket) Bytes() []byte

func (*RocPacket) Len

func (r *RocPacket) Len() int

func (*RocPacket) String

func (r *RocPacket) String() string

func (*RocPacket) Write

func (r *RocPacket) Write(b []byte)

type StreamHandler

type StreamHandler func(c *context.Context, req *RocPacket) (chan proto.Message, chan error)

type Wrapper

type Wrapper func(c *context.Context) error

Directories

Path Synopsis
Package metadata for websocket or socket from rsocket-rpc-go Metadata
Package metadata for websocket or socket from rsocket-rpc-go Metadata

Jump to

Keyboard shortcuts

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