archium

package
v0.0.0-...-6216d25 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package archium is a simple PubSub-Service

Index

Constants

View Source
const AppName string = "goBlue/archium"

AppName is the name of the application

FullVersion contains the full name and version of this package in a printable string

View Source
const VersionBuild string = "s"

VersionBuild is the type of this release. s(table), b(eta), d(evelopment), n(ightly)

View Source
const VersionMajor string = "0"

VersionMajor 0 means in development, >1 ensures compatibility with each minor version, but breakes with new major version

View Source
const VersionMinor string = "2"

VersionMinor introduces changes that require a new version number. If the major version is 0, they are likely to break compatibility

Variables

View Source
var ArchiumCore _ArchiumCore

ArchiumCore - Singleton

Functions

This section is empty.

Types

type DebugListener

type DebugListener struct {
}

DebugListener is a basic listener which listens to everything and logs it to debug

func (*DebugListener) GetTypes

func (adl *DebugListener) GetTypes() []string

GetTypes returns a single wildcard for everything to catch every single Event

func (*DebugListener) Trigger

func (adl *DebugListener) Trigger(ae Event)

Trigger of the DebugListener logs everything on LogLevel debug

type Event

type Event struct {
	EventType, EventSource string
	Data                   map[string]interface{}
}

Event is an event that is fired by something. Data is a map<string, anything>, EventType is the type of the Event, often referred to as "topic"

func CreateEvent

func CreateEvent() *Event

CreateEvent creates a new event - does NOT fire it!

type EventListener

type EventListener interface {
	Trigger(ae Event)
	GetTypes() []string
}

EventListener provides an interface for custom listeners. Trigger is activated if type of an occurred event matches any type returned by GetTypes. GetTypes also can return static strings.

Jump to

Keyboard shortcuts

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