Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobPluginLookup ¶
type JobPluginLookup struct {
// contains filtered or unexported fields
}
func NewJobPluginLookup ¶
func NewJobPluginLookup(archetype *baseservice.Archetype) *JobPluginLookup
func (*JobPluginLookup) ByJobArgs ¶
func (c *JobPluginLookup) ByJobArgs(args rivertype.JobArgs) *PluginLookup
ByJobArgs returns a plugin lookup for the given job args.
type PluginKind ¶
type PluginKind string
const ( PluginKindHookInsertBegin PluginKind = "hook_insert_begin" PluginKindHookMetricEmit PluginKind = "hook_metric_emit" PluginKindHookPeriodicJobsStart PluginKind = "hook_periodic_jobs_start" PluginKindHookWorkBegin PluginKind = "hook_work_begin" PluginKindHookWorkEnd PluginKind = "hook_work_end" PluginKindMiddlewareJobInsert PluginKind = "middleware_job_insert" PluginKindMiddlewareWorker PluginKind = "middleware_worker" )
type PluginLookup ¶ added in v0.42.0
type PluginLookup struct {
// contains filtered or unexported fields
}
PluginLookup looks up plugins by kind. Its zero value is an empty lookup.
func NewPluginLookup ¶
func NewPluginLookup(plugins []any) *PluginLookup
NewPluginLookup returns a new plugin lookup based on the given plugins. Each input is considered for every hook and middleware kind it implements.
The plugins parameter is []any rather than []rivertype.Plugin because the lookup may contain legacy hooks and middleware that don't implement rivertype.Plugin. Keeping their original concrete values avoids compatibility wrappers that would need to forward every operation-specific interface.
func NewPluginLookupFromConfig ¶
func NewPluginLookupFromConfig(archetype *baseservice.Archetype, hooks []rivertype.Hook, middlewares []rivertype.Middleware, plugins []rivertype.Plugin) *PluginLookup
NewPluginLookupFromConfig returns a plugin lookup from separately configured hooks, middleware, and plugins. Explicit plugins may participate as either hooks or middleware, while entries from the legacy Hooks and Middleware configuration fields participate only as the kind they were configured as. Base services embedded in any configured extension are initialized with archetype when it's non-nil.
func (*PluginLookup) ByKind ¶ added in v0.42.0
func (c *PluginLookup) ByKind(kind PluginKind) []any
func (*PluginLookup) Hooks ¶ added in v0.42.0
func (c *PluginLookup) Hooks() []rivertype.Hook
Hooks returns all the hooks in the lookup in configuration order.