observers

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetObserver

func SetObserver(observer Observer)

SetObserver by observer name

Types

type AbstractObserver

type AbstractObserver struct {
	widgets.AbstractStrategyWidget
}

AbstractObserver abstract component of visotor

type DefaultObserversFactory

type DefaultObserversFactory interface {
	Get(name string) Observer
	Set(Observer)
	GetAll() []Observer
}

DefaultObserversFactory default factory of observers

func GetDefaultObserversChain

func GetDefaultObserversChain() DefaultObserversFactory

GetDefaultObserversChain for each controllers default observer

type Observer

type Observer interface {
	widgets.PatternWidget
	Observe(event events.Event)
}

Observer interface

func GetObserver

func GetObserver(name string) Observer

GetObserver by observer name

func NewOperateLogObserver

func NewOperateLogObserver() Observer

NewOperateLogObserver new operation observer

func NewStdMQObserver

func NewStdMQObserver(payloadFrom string, topicCategory string, observerTopic string, observerRoutingKey string, matchPattern string) Observer

NewStdMQObserver new observer

type ObserverOperator

type ObserverOperator interface {
	AttachObserver(observer Observer) bool
	RemoveObserver(name string) bool
	GetObservers(string) []Observer
	InitializeObservers(from string)
}

ObserverOperator interface for controller operation

type ObserversChain

type ObserversChain struct {
	widgets.AbstractStrategyWidget
	// contains filtered or unexported fields
}

ObserversChain responsibility chain of observers

func NewObserversChain

func NewObserversChain(name string, matchPattern string) *ObserversChain

NewObserversChain responsibility chain of observers

func (*ObserversChain) AttachObserver

func (c *ObserversChain) AttachObserver(observer Observer) bool

AttachObserver on observer responsibility chain

func (*ObserversChain) GetObservers

func (c *ObserversChain) GetObservers(pattern string) []Observer

GetObservers of observer responsibility chain

func (*ObserversChain) InitializeObservers

func (c *ObserversChain) InitializeObservers(from string)

InitializeObservers called from controller analyzement on loading

func (*ObserversChain) LoadStrategies

func (c *ObserversChain) LoadStrategies(strategies []string)

LoadStrategies for controller handlers

func (*ObserversChain) RemoveObserver

func (c *ObserversChain) RemoveObserver(name string) bool

RemoveObserver on observer responsibility chain

type ObserversResponsibilityChain

type ObserversResponsibilityChain interface {
	AttachObserver(observer Observer) bool
	GetObservers(string) []Observer
}

ObserversResponsibilityChain

type ObserversStrategy

type ObserversStrategy interface {
	Observers() []Observer
}

ObserversStrategy interface of visitors strategy

Jump to

Keyboard shortcuts

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