event

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// Hash is a unique hash to identify event.
	Hash github_com_mesg_foundation_engine_hash.Hash `` /* 148-byte string literal not displayed */
	// instanceHash is hash of instance that can proceed an execution.
	InstanceHash github_com_mesg_foundation_engine_hash.Hash `` /* 169-byte string literal not displayed */
	// key is the key of the event.
	Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty" hash:"name:3" validate:"required,printascii"`
	// data is the data for the event.
	Data                 *types.Struct `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty" hash:"name:4"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

Event represents a single event run in engine.

func New added in v0.19.0

func New(instanceHash hash.Hash, eventKey string, eventData *types.Struct) *Event

New creates an event eventKey with eventData for service s.

func (*Event) Descriptor added in v0.14.0

func (*Event) Descriptor() ([]byte, []int)

func (*Event) ProtoMessage added in v0.14.0

func (*Event) ProtoMessage()

func (*Event) Reset added in v0.14.0

func (m *Event) Reset()

func (*Event) String added in v0.14.0

func (m *Event) String() string

func (*Event) XXX_DiscardUnknown added in v0.14.0

func (m *Event) XXX_DiscardUnknown()

func (*Event) XXX_Marshal added in v0.14.0

func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Event) XXX_Merge added in v0.14.0

func (m *Event) XXX_Merge(src proto.Message)

func (*Event) XXX_Size added in v0.14.0

func (m *Event) XXX_Size() int

func (*Event) XXX_Unmarshal added in v0.14.0

func (m *Event) XXX_Unmarshal(b []byte) error

type Filter added in v0.19.0

type Filter struct {
	Hash         hash.Hash
	InstanceHash hash.Hash
	Key          string
}

Filter store fileds for matching events.

func (*Filter) HasKey added in v0.19.0

func (f *Filter) HasKey() bool

HasKey returns true if key is set to specified value.

func (*Filter) Match added in v0.19.0

func (f *Filter) Match(e *Event) bool

Match matches event.

type Listener added in v0.19.0

type Listener struct {
	C chan *Event
	// contains filtered or unexported fields
}

Listener provides functionalities to listen MESG events.

func NewListener added in v0.19.0

func NewListener(ps *pubsub.PubSub, topic string, f *Filter) *Listener

NewListener creates a new Listener with given sdk and filters.

func (*Listener) Close added in v0.19.0

func (l *Listener) Close()

Close stops listening for events.

func (*Listener) Listen added in v0.19.0

func (l *Listener) Listen()

Listen listens events that match filter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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