eventsmanager

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventObject

type EventObject interface {
	GetEventArgs() interface{}
	HasEventArgs() bool
	StopPropagation() bool
	IsParallelPropagation() bool
	GetTypeOfFunc() reflect.Type
}

EventObject is the definition of a object responsible to make an event

type Publisher

type Publisher interface {
	Publish(event EventObject)
}

Publisher defines an object responsible to publish events

func NewPublisher

func NewPublisher(subscriptions SubscriptionsGetter, errorCatcher errors.ErrorCatcher) Publisher

NewPublisher returns a Publisher

type Subscriptions

type Subscriptions interface {
	SubscriptionsGetter
	Add(event EventObject, subscribeFunc interface{})
	Remove(event EventObject, subscribeFunc interface{})
}

Subscriptions is the definition of a object responsible to store subscriptions for an event

func NewSubscriptions

func NewSubscriptions(errorDefer errors.ErrorDefer) Subscriptions

NewSubscriptions returns a Subscriptions

type SubscriptionsError

type SubscriptionsError interface {
	errors.CustomError
	GetErrorType() SubscriptionsErrorType
}

type SubscriptionsErrorType

type SubscriptionsErrorType uint8
const (
	Unexpected SubscriptionsErrorType = iota
	BadFunctionSignature
	FunctionNoSubscribed
)

type SubscriptionsGetter added in v1.1.0

type SubscriptionsGetter interface {
	GetAlls(event EventObject) []reflect.Value
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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