subscriptions

package
v0.0.0-...-7a34736 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 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 CallbackFn

type CallbackFn func(notification *Notification)

type Notification

type Notification struct {
	Subject interface{}
	Entity  interface{}
	Reason  string
}

type Subject

type Subject struct {
	Subscribers []CallbackFn
	// contains filtered or unexported fields
}

func NewSubject

func NewSubject() *Subject

func (*Subject) GetNotification

func (s *Subject) GetNotification(fn CallbackFn)

func (*Subject) Notify

func (s *Subject) Notify(entity interface{}, reason string)

func (*Subject) Subscribe

func (s *Subject) Subscribe(fn CallbackFn)

Jump to

Keyboard shortcuts

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