types

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	ID        string           `db:"id" json:"id" validate:"required" description:"The ID of the job."`
	Name      string           `db:"name" json:"name" validate:"required" description:"The name of the job."`
	Output    *Output          `db:"output" json:"output" description:"The output of the job."`
	Fields    map[string]any   `` /* 131-byte string literal not displayed */
	Statuses  []map[string]any `db:"statuses" json:"statuses" validate:"required" description:"The job statuses."`
	GuildID   string           `db:"guild_id" json:"guild_id" validate:"required" description:"The ID of the guild the job is for."`
	Expiry    *time.Duration   `db:"expiry" json:"expiry" validate:"required" description:"The job expiry."`
	State     string           `db:"state" json:"state" validate:"required" description:"The jobs' current state (pending/completed etc)."`
	Resumable bool             `db:"resumable" json:"resumable" description:"Whether the job is resumable."`
	CreatedAt time.Time        `db:"created_at" json:"created_at" description:"The time the job was created."`
}

@ci table=jobs

Jobs are background processes that can be run on a coordinator server.

type JobCreateResponse

type JobCreateResponse struct {
	ID string `json:"id" description:"The id of the job"`
}

type JobListResponse

type JobListResponse struct {
	Jobs []PartialJob `json:"jobs" description:"The list of (partial) jobs"`
}

type Output

type Output struct {
	Filename string        `json:"filename"`
	Buffer   *bytes.Buffer `json:"-"`
}

Output is the output of a job

type PartialJob

type PartialJob struct {
	ID        string         `db:"id" json:"id" validate:"required" description:"The ID of the job."`
	Name      string         `db:"name" json:"name" validate:"required" description:"The name of the job."`
	Expiry    *time.Duration `db:"expiry" json:"expiry" validate:"required" description:"The job expiry."`
	State     string         `db:"state" json:"state" validate:"required" description:"The jobs' current state (pending/completed etc)."`
	CreatedAt time.Time      `db:"created_at" json:"created_at" description:"The time the job was created."`
}

@ci table=jobs unfilled=1

A PartialJob represents a partial representation of a job.

Jump to

Keyboard shortcuts

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