events

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Overview

Package events define a generic type of event for implementing of an event distribution mechanism.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigEvent

type ConfigEvent EventHappend

ConfigEvent a configuration event

func (*ConfigEvent) Clone

func (ce *ConfigEvent) Clone() Event

Clone clones the Event

func (*ConfigEvent) GetClient

func (ce *ConfigEvent) GetClient() interface{}

GetClient returns the stream client corresponding to the given ConfigEvent

func (*ConfigEvent) GetSubject

func (ce *ConfigEvent) GetSubject() string

GetSubject returns the subject of the event

func (*ConfigEvent) GetTime

func (ce *ConfigEvent) GetTime() time.Time

GetTime returns the time when the event occurs

func (*ConfigEvent) GetType

func (ce *ConfigEvent) GetType() EventType

GetType returns type of an Event

func (*ConfigEvent) GetValues

func (ce *ConfigEvent) GetValues() interface{}

GetValues returns the values of the event

type Event

type Event interface {
	GetType() EventType
	GetTime() time.Time
	GetValues() interface{}
	GetSubject() string
	Clone() Event
}

Event an interface which defines the Event methods

type EventHappend

type EventHappend struct {
	Subject string
	Time    time.Time
	Etype   EventType
	Values  interface{}
	Client  interface{}
}

EventHappend is a general purpose base type of event

func (*EventHappend) Clone

func (eh *EventHappend) Clone() Event

Clone clones the Event

func (*EventHappend) GetSubject

func (eh *EventHappend) GetSubject() string

GetSubject returns the subject of the event

func (*EventHappend) GetTime

func (eh *EventHappend) GetTime() time.Time

GetTime returns the time when the event occurs

func (*EventHappend) GetType

func (eh *EventHappend) GetType() EventType

GetType returns type of an Event

func (*EventHappend) GetValues

func (eh *EventHappend) GetValues() interface{}

GetValues returns the values of the event

type EventType

type EventType uint16

EventType is an enumeration of the kind of events that can occur.

const (
	EventTypeConfiguration EventType = iota
	EventTypeOperationalState
	EventTypeRandom
)

Values of the EventType enumeration

func (EventType) String

func (et EventType) String() string

type RandomEvent

type RandomEvent EventHappend

RandomEvent a random event

func (*RandomEvent) Clone

func (ce *RandomEvent) Clone() Event

Clone clones the Event

func (*RandomEvent) GetSubject

func (ce *RandomEvent) GetSubject() string

GetSubject returns the subject of the event

func (*RandomEvent) GetTime

func (ce *RandomEvent) GetTime() time.Time

GetTime returns the time when the event occurs

func (*RandomEvent) GetType

func (ce *RandomEvent) GetType() EventType

GetType returns type of an Event

func (*RandomEvent) GetValues

func (ce *RandomEvent) GetValues() interface{}

GetValues returns the values of the event

Jump to

Keyboard shortcuts

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