observable

package
v0.1.19-debugging Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SAVE event type used for storing
	SAVE = "save"
	// DELETE event type used for deletion
	DELETE = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	EventType string
	Key       string
	Value     interface{}
}

Event object in observables

type Observable

type Observable interface {
	AddObserver(observer Observer)
	Notify(event *Event)
	RemoveObserver(observer interface{})
}

Observable can be used for listening changes on cache

type Observer

type Observer interface {
	NotifyCallback(event *Event)
}

Observer notify all observable clients

Jump to

Keyboard shortcuts

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