hooks

package
v0.15.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContainerCreated = new(Hook[forge.Container])
	ContainerStarted = new(Hook[forge.Container])
)

Functions

This section is empty.

Types

type Hook

type Hook[T any] struct {
	Listeners []func(context.Context, T)
	sync.Mutex
}

func (*Hook[T]) Dispatch

func (h *Hook[T]) Dispatch(ctx context.Context, t T)

func (*Hook[T]) Listen

func (h *Hook[T]) Listen(f ...func(context.Context, T))

Jump to

Keyboard shortcuts

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