triggers

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func ContextFrom

func ContextFrom(ctx context.Context) Context

func NewContext

func NewContext(ctx context.Context, log *slog.Logger) Context

func (Context) As

func (ctx Context) As(userID string) Context

func (Context) Deadline

func (ctx Context) Deadline() (time.Time, bool)

func (Context) Debug

func (ctx Context) Debug(msg string, args ...any)

func (Context) Done

func (ctx Context) Done() <-chan struct{}

func (Context) Err

func (ctx Context) Err() error

func (Context) Error

func (ctx Context) Error(msg string, args ...any)

func (Context) Info

func (ctx Context) Info(msg string, args ...any)

func (Context) Job

func (ctx Context) Job() jobs.Context

func (Context) Value

func (ctx Context) Value(key any) any

func (Context) Warn

func (ctx Context) Warn(msg string, args ...any)

func (Context) With

func (ctx Context) With(key string, value any) Context

type Interface

type Interface interface {
	ID() string
	Run(ctx Context, jobs Jobs)
}

type Jobs

type Jobs interface {
	Run(ctx jobs.Context, now time.Time, userID string, jobIDs []string) []jobs.Result
}

type Registry

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

func NewRegistry

func NewRegistry(log *slog.Logger) *Registry

func (*Registry) Close

func (r *Registry) Close() (errs error)

func (*Registry) Register

func (r *Registry) Register(trigger Interface)

func (*Registry) Run

func (r *Registry) Run(ctx context.Context, job Jobs)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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