event

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 (
	ErrEventEncoderNotFound = errors.New("event encoder not found")
	ErrEventDecoderNotFound = errors.New("event decoder 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) Decode

func (e *Codec) Decode(ctx context.Context, streamType string, eventType string, bytes []byte) (event interface{}, err error)

func (*Codec) Default

func (e *Codec) Default(enc es.EncodeFunc, dec es.DecodeFunc)

func (*Codec) Encode

func (e *Codec) Encode(ctx context.Context, streamType string, eventType string, event interface{}) (bytes []byte, err error)

func (*Codec) Stream

func (e *Codec) Stream(streamType string) *Event

type Event

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

func (*Event) Decode

func (ec *Event) Decode(ctx context.Context, eventType string, bytes []byte) (event interface{}, err error)

func (*Event) Default

func (ec *Event) Default(enc es.EncodeFunc, dec es.DecodeFunc)

func (*Event) Encode

func (ec *Event) Encode(ctx context.Context, eventType string, event interface{}) (bytes []byte, err error)

func (*Event) Event

func (ec *Event) Event(eventType string, enc es.EncodeFunc, dec es.DecodeFunc) *Event

Jump to

Keyboard shortcuts

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