observer

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observable

type Observable struct {
	Observers []Observer
	Notifies  []time.Time
}

func (*Observable) AddObserver

func (o *Observable) AddObserver(os Observer)

func (*Observable) HasObservers

func (o *Observable) HasObservers() bool

func (*Observable) NotifyAll

func (o *Observable) NotifyAll(value string)

type Observer

type Observer interface {
	Update(value string)
}

type Watcher

type Watcher struct {
	Name string
}

func CreateWatcher

func CreateWatcher(name string) *Watcher

func (*Watcher) Update

func (c *Watcher) Update(value string)

Jump to

Keyboard shortcuts

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