Event

package
v0.0.0-...-a93fc24 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelayedEvent

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

DelayedEvent is an Event which waits a certain time and then sends itself in the given queue

func NewDelayedEvent

func NewDelayedEvent(event *Event, delay time.Duration, resultQueue chan Event) *DelayedEvent

NewDelayedEvent creates a new DelayedEvent

func (DelayedEvent) IsWaiting

func (dEvent DelayedEvent) IsWaiting() bool

IsWaiting returns true if the DelayedEvent has not been sent to the event queue

func (*DelayedEvent) Start

func (dEvent *DelayedEvent) Start()

Start starts waiting

func (DelayedEvent) Stop

func (dEvent DelayedEvent) Stop()

Stop cancels the event

type Event

type Event struct {
	DataRaw []byte
	Data    map[string]interface{}
	Created time.Time
}

Event represents a JSON event

func NewEventFromBytes

func NewEventFromBytes(jsonBytes []byte) (*Event, error)

NewEventFromBytes creates an Event from a byte array

func NewEventFromInterface

func NewEventFromInterface(jsonInterface interface{}) (*Event, error)

NewEventFromInterface creates an Event from a empty interface

func (Event) GetDataAsBytes

func (event Event) GetDataAsBytes() []byte

GetDataAsBytes returns the internal data as bytes

func (Event) GetDataAsInterface

func (event Event) GetDataAsInterface() map[string]interface{}

GetDataAsInterface returns the internal data as object

func (Event) String

func (event Event) String() string

String returns the internal data as string

Jump to

Keyboard shortcuts

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