core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package core implements commonly used tools.

Documentation Last Review: 08.10.2020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observable

type Observable interface {
	// Add adds the observer to the list of observers that will be notified of
	// new events.
	Add(observer Observer)

	// Remove removes the observer from the list thus stopping it from receiving
	// new events.
	Remove(observer Observer)

	// Notify notifies the observers of a new event.
	Notify(event interface{})
}

Observable provides primitives to add and remove observers and to notify them of new events.

type Observer

type Observer interface {
	NotifyCallback(event interface{})
}

Observer is the interface to implement to watch events.

type Watcher

type Watcher struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Watcher is an implementation of the Observable interface.

- implements core.Observable

func NewWatcher

func NewWatcher() *Watcher

NewWatcher creates a new empty watcher.

func (*Watcher) Add

func (w *Watcher) Add(observer Observer)

Add implements core.Observable. It adds the observer to the list of observers that will be notified of new events.

func (*Watcher) Notify

func (w *Watcher) Notify(event interface{})

Notify implements core.Observable. It notifies the whole list of observers one after each other.

func (*Watcher) Remove

func (w *Watcher) Remove(observer Observer)

Remove implements core.Observable. It removes the observer from the list thus stopping it from receiving new events.

Directories

Path Synopsis
Package access defines the interfaces for Access Rights Controls.
Package access defines the interfaces for Access Rights Controls.
Package execution defines the service to execute a step in a validation batch.
Package execution defines the service to execute a step in a validation batch.
Package ordering defines the interface of the ordering service.
Package ordering defines the interface of the ordering service.
Package store defines the primitives of a simple key/value storage.
Package store defines the primitives of a simple key/value storage.
txn
Package txn defines the abstraction of transactions.
Package txn defines the abstraction of transactions.
Package validation defines a validation service that will apply a batch of transactions to a store snapshot.
Package validation defines a validation service that will apply a batch of transactions to a store snapshot.

Jump to

Keyboard shortcuts

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