command

package
v0.0.0-...-3b037d6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommandEncoderNotFound = errors.New("command encoder not found")
	ErrCommandDecoderNotFound = errors.New("command decoder not found")
	ErrReplyDecoderNotFound   = errors.New("reply decoder not found")
	ErrReplyEncoderNotFound   = errors.New("reply encoder not found")
	ErrNoStream               = errors.New("no stream type")
)

Functions

This section is empty.

Types

type Codec

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

func New

func New() *Codec

func (*Codec) DecodeCommand

func (c *Codec) DecodeCommand(ctx context.Context, streamType string, commandType string, bytes []byte) (payload interface{}, err error)

func (*Codec) DecodeReply

func (c *Codec) DecodeReply(ctx context.Context, streamType string, replyType string, bytes []byte) (payload interface{}, err error)

func (*Codec) EncodeCommand

func (c *Codec) EncodeCommand(ctx context.Context, streamType string, commandType string, payload interface{}) (bytes []byte, err error)

func (*Codec) EncodeReply

func (c *Codec) EncodeReply(ctx context.Context, streamType string, replyType string, payload interface{}) (bytes []byte, err error)

func (*Codec) Stream

func (c *Codec) Stream(streamType string) *Stream

type Command

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

type Reply

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

type Stream

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

func (*Stream) Command

func (s *Stream) Command(name string, enc es.EncodeFunc, dec es.DecodeFunc) *Stream

func (*Stream) Reply

func (s *Stream) Reply(name string, enc es.EncodeFunc, dec es.DecodeFunc) *Stream

Jump to

Keyboard shortcuts

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