observer

package
v1.3.15 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Notifier is an interface that defines methods for managing observers and notifying them of status changes. It allows observers to register, unregister, and receive notifications.

Package observer provides an interface for implementing the observer pattern. The Observer interface defines a method for receiving notifications about status changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

func (*Notifier) Notify

func (n *Notifier) Notify(status types.StatusEventArgs) error

func (*Notifier) Register

func (n *Notifier) Register(o Observer)

func (*Notifier) Unregister

func (n *Notifier) Unregister()

type Observer

type Observer interface {
	// OnNotify is called when the status changes
	OnNotify(types.StatusEventArgs) error
}

Jump to

Keyboard shortcuts

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