Observer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Data string
	// contains filtered or unexported fields
}

type IObserver

type IObserver interface {
	Update(*Event)
}

type ISubject

type ISubject interface {
	Register(...IObserver)
	Dismiss(...IObserver)
	Notify(*Event)
}

type Observer

type Observer struct {
	Id int
}

func (*Observer) Update

func (o *Observer) Update(event *Event)

type Subject

type Subject struct {
	// contains filtered or unexported fields
}

func (*Subject) Dismiss

func (s *Subject) Dismiss(observers ...IObserver)

func (*Subject) Notify

func (s *Subject) Notify(event *Event)

func (*Subject) Register

func (s *Subject) Register(observers ...IObserver)

Jump to

Keyboard shortcuts

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