es

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 9 Imported by: 0

README

es

Event stream in go

Documentation

Index

Constants

View Source
const (
	// ErrMarshalEvent -
	ErrMarshalEvent = Error("unable to marshal event")

	// ErrUnmarshalEvent -
	ErrUnmarshalEvent = Error("unable to unmarshal event")

	// ErrUnknownEventType -
	ErrUnknownEventType = Error("unknown event type")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

Error -

func (Error) Error

func (e Error) Error() string

type Event

type Event interface{}

Event -

type Identity added in v0.1.1

type Identity struct {
	UserID    string `json:"_au"`
	UserOrgID string `json:"_ao"`
	UserRole  string `json:"_ar"`
}

type Model

type Model struct {
	EventID  string    `json:"_e"`
	Version  int       `json:"_v"`
	At       time.Time `json:"_t"`
	Identity Identity  `json:"_i"`
}

Model -

func NewModel added in v0.1.1

func NewModel(identity Identity) *Model

type PublisherOption

type PublisherOption func() error

type Record

type Record struct {
	At   time.Time
	Type string
	Data string
}

TODO: rename to Entry

type Streamer

type Streamer interface {
	Commit(partitionKey string, event Event) error
	Push(ctx context.Context) error
	Clear()
}

Streamer -

func NewStreamer

func NewStreamer(streamName string) (Streamer, error)

NewStreamer - Options:

|> stream-name - required
|> kinesis-region - optional
|> retry policy - optional

type Unmarshaler

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

Unmarshaler - TODO: add init methods for binding

func NewUnmarshaler

func NewUnmarshaler(events ...interface{}) *Unmarshaler

NewUnmarshaler -

func (Unmarshaler) Unmarshal

func (unmarshaler Unmarshaler) Unmarshal(data []byte) (interface{}, error)

Unmarshal -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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