events

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncPublisher

type FuncPublisher[T any] func(context.Context, T) error

FuncPublisher wraps a plain func as a Publisher.

func ChannelPublisher

func ChannelPublisher[T any](events chan<- T) FuncPublisher[T]

ChannelPublisher wraps a plain channel as a Publisher.

func (FuncPublisher[T]) Publish

func (f FuncPublisher[T]) Publish(ctx context.Context, e T) error

Publish implements Publisher for FuncPublisher.

type NilPublisher

type NilPublisher[T any] struct{}

NilPublisher is a publisher than does nothing and returns no errors. Useful for testing.

func (NilPublisher[T]) Publish

func (f NilPublisher[T]) Publish(ctx context.Context, e T) error

Publish implements Publisher for NilPublisher.

type Publisher

type Publisher[T any] interface {
	Publish(context.Context, T) error
}

Publisher defines an interface on which the Docker lib publishes asynchronous events, such as logs or stats.

Jump to

Keyboard shortcuts

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