observer

package module
v0.0.0-...-5fe69d9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: MIT Imports: 5 Imported by: 0

README

observer

Golang observer pattern lib, with topics for different channels

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateID

func CreateID() ulid.ULID

Types

type Observer

type Observer interface {
	RegisterCallback(id ulid.ULID, topicName string, callback func(data interface{}))
	RegisterChannel(id ulid.ULID, topicName string, channel chan interface{})

	UnregisterCallback(id ulid.ULID, topicName string)
	UnregisterChannel(id ulid.ULID, topicName string)

	Send(topicName string, data interface{})
	SendTo(topicName string, data interface{}, sendToIDs map[ulid.ULID]bool)
	SendExcept(topicName string, data interface{}, filterOutIDs map[ulid.ULID]bool)
}

func New

func New() Observer

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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