observer

package
v0.0.0-...-56aa9b5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 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 MockObserver

type MockObserver[T interface{}] struct {
	mock.Mock
}

MockObserver is an autogenerated mock type for the Observer type

func NewMockObserver

func NewMockObserver[T interface{}](t mockConstructorTestingTNewMockObserver) *MockObserver[T]

NewMockObserver creates a new instance of MockObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockObserver[T]) Publish

func (_m *MockObserver[T]) Publish(value T)

Publish provides a mock function with given fields: value

func (*MockObserver[T]) Subscribe

func (_m *MockObserver[T]) Subscribe() <-chan T

Subscribe provides a mock function with given fields:

type Observer

type Observer[T any] interface {
	Publisher[T]
	Subscriber[T]
}

func New

func New[T any]() Observer[T]

type Publisher

type Publisher[T any] interface {
	Publish(value T)
}

type Subscriber

type Subscriber[T any] interface {
	Subscribe() <-chan T
}

Jump to

Keyboard shortcuts

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