described

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package described declares the types of the registry tests of api.Descriptions. Their comments are what the tests read with descriptions.Read and expect in the documents, so change both together.

Index

Constants

This section is empty.

Variables

View Source
var Statuses = enums.Set([]Status{Pending, Done})

Functions

This section is empty.

Types

type ArchiveRequest

type ArchiveRequest struct {
	requests.NoRules
	Scope
	// Reason says why the runs are archived.
	Reason string `json:"reason"`
}

ArchiveRequest archives the runs of a project. Only a hidden operation takes it.

type Audit

type Audit struct {
	Stamp
	// Author wrote the record.
	Author string `json:"author,omitempty"`
}

Audit says who wrote a record.

type CreateRequest

type CreateRequest struct {
	requests.NoRules
	Scope
	// Limit caps the steps of the run.
	Limit int `json:"-" query:"limit" minimum:"1"`
	// Trace follows the request across services.
	Trace string `json:"-" header:"x-trace"`
	// Name is what the new run is called.
	Name string `json:"name" required:"true" minLength:"1"`
	// Owner starts the new run.
	Owner *Owner `json:"owner,omitempty"`
}

CreateRequest starts a run.

type ListRequest

type ListRequest struct {
	requests.NoRules
	Scope
}

ListRequest lists the runs of a project.

type Owner

type Owner struct {
	Email string `json:"email"` // Email reaches the owner.
}

Owner is the person who started a run.

type Page

type Page[T any] struct {
	// Items are the entries of the page.
	Items []T `json:"items"`
}

Page is one page of a list.

func List

func List(ctx context.Context, req *ListRequest) (Page[Run], error)

List handles ListRequest.

type Record

type Record struct {
	// ID identifies the record.
	ID string `json:"id"`
}

Record holds what every stored record has.

type Run

type Run struct {
	Record
	*Audit
	// Name is what the user calls the run.
	Name string `json:"name"`
	// Label has a comment its doc tag replaces.
	Label string `json:"label" doc:"Label from the tag."`
	// Note has a comment its empty doc tag hides.
	Note string `json:"note" doc:""`
	// Owner started the run.
	Owner Owner `json:"owner"`
	// Status tells where the run is.
	Status Status `json:"status"`
	Plain  string `json:"plain"`
}

Run is one execution of a job.

func Create

func Create(ctx context.Context, req *CreateRequest) (Run, error)

Create handles CreateRequest.

type Scope

type Scope struct {
	// Project is the project the run belongs to.
	Project string `json:"-" path:"project"`
}

Scope names the project of a request.

type Stamp

type Stamp struct {
	// At is when it happened.
	At string `json:"at,omitempty"`
}

Stamp says when something happened.

type Status

type Status string

Status is where a run is.

const (
	Pending Status = "pending"
	Done    Status = "done"
)

type UploadRequest

type UploadRequest struct {
	requests.NoRules
	Scope
	// Log is the file to attach.
	Log *multipart.FileHeader `json:"-" form:"log" required:"true"`
	// Extras are more files to attach.
	Extras []*multipart.FileHeader `json:"-" form:"extras"`
	// Comment says what the log shows.
	Comment string `json:"comment"`
}

UploadRequest attaches a log to a run.

type UploadResponse

type UploadResponse struct {
	// Size is the size of the log in bytes.
	Size int64 `json:"size"`
}

UploadResponse tells what was attached.

func Archive

func Archive(ctx context.Context, req *ArchiveRequest) (UploadResponse, error)

Archive handles ArchiveRequest.

func Upload

func Upload(ctx context.Context, req *UploadRequest) (UploadResponse, error)

Upload handles UploadRequest.

Jump to

Keyboard shortcuts

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