hooklookup

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookKind

type HookKind string
const (
	HookKindInsertBegin HookKind = "insert_begin"
	HookKindWorkBegin   HookKind = "work_begin"
)

type HookLookupInterface

type HookLookupInterface interface {
	ByHookKind(kind HookKind) []rivertype.Hook
}

HookLookupInterface is an interface to look up hooks by hook kind. It's commonly implemented by HookLookup, but may also be EmptyHookLookup as a memory allocation optimization for bundles where no hooks are present.

func NewHookLookup

func NewHookLookup(hooks []rivertype.Hook) HookLookupInterface

NewHookLookup returns a new hook lookup interface based on the given hooks that satisfies HookLookupInterface. This is often hookLookup, but may be emptyHookLookup as an optimization for the common case of an empty hook bundle.

type JobHookLookup

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

func NewJobHookLookup

func NewJobHookLookup() *JobHookLookup

func (*JobHookLookup) ByJobArgs

ByJobArgs returns a HookLookupInterface by job args, which is a HookLookup if the job args had specific hooks (i.e. implements JobArgsWithHooks and returns a non-empty set of hooks), or an EmptyHashLookup otherwise.

Jump to

Keyboard shortcuts

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