interfaces

package
v0.0.0-...-840200a Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

To avoid circular dependencies, interfaces contains the core implementation of the job interfaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobImpl

type JobImpl interface {
	// Name returns the name of the job
	Name() string

	// Owner returns who the job is for
	GuildID() string

	// As jobs often deal with sensitive data such as secrets, the Fields method returns
	// a map of fields that can be stored in the database
	Fields() map[string]any

	// Validate validates and sets up state if needed
	Validate(state jobstate.State) error

	// Exec executes the job returning an output if any
	Exec(l *zap.Logger, state jobstate.State, progstate jobstate.ProgressState) (*types.Output, error)

	// Expiry returns when the job will expire (if any), setting this to nil will make the job not expire
	Expiry() *time.Duration

	// Resumable returns whether or not the job is resumable
	Resumable() bool

	// LocalPresets returns the preset options of a job
	LocalPresets() *PresetInfo
}

JobImpl provides the definition for any job that can be executed on splashtail

type PresetInfo

type PresetInfo struct {
	// Whether or not this job should be runnable
	Runnable bool

	// The default options/data
	Preset JobImpl

	// Any comments for specific fields
	Comments map[string]string
}

Jump to

Keyboard shortcuts

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