mock

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Title string
	Body  string
}

type Notifier

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

func NewNotifier

func NewNotifier() *Notifier

func (*Notifier) Receive

func (n *Notifier) Receive(ctx context.Context) (Notification, error)

func (*Notifier) Send

func (n *Notifier) Send(ctx context.Context, title, body string) error

Send implements notify.Notifier

type ReadCtx

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

ReadCtx is a mocked reading context that can be used for mocking messages.

func (*ReadCtx) Close

func (r *ReadCtx) Close()

Close must be called to terminate the ReadCtx. It closes the channel returned by done. It can be called multiple times.

func (*ReadCtx) Done

func (r *ReadCtx) Done() <-chan struct{}

func (*ReadCtx) MockMessage

func (r *ReadCtx) MockMessage(ctx context.Context, message types.Message) error

MockMessage sends a mock message.

type Reader

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

Reader is a component that can be used for mocking.

func NewReader

func NewReader(id types.ReaderID) *Reader

NewReader creates a new instance of Reader.

func (*Reader) Accept

func (r *Reader) Accept(ctx context.Context) (*ReadCtx, error)

Accept must be called by the user of this mock to ReadLogs. The resulting ReadCtx can be used to mock messages.

func (*Reader) ReadLogs

func (r *Reader) ReadLogs(ctx context.Context, params types.ReadLogsParams) error

ReadLogs implements types.Reader.

func (*Reader) ReaderID

func (r *Reader) ReaderID() types.ReaderID

ReaderID implements types.Reader.

Jump to

Keyboard shortcuts

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