backend

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package backend defines resolved build-backend messages.

Index

Constants

View Source
const (
	ProtocolVersion = 1
	SchemaVersion   = 2
)

Variables

View Source
var (
	ErrInvalidOperation = errors.New("backend: invalid operation")
	ErrMissingProfile   = errors.New("backend: project has no selected profile")
	ErrMissingEntry     = errors.New("backend: build requires an entry")
	ErrMissingOutput    = errors.New("backend: build or run requires an output")
	ErrInvalidDefine    = errors.New("backend: define value must be scalar")
	ErrInvalidCompiler  = errors.New("backend: compiler path must be absolute")
	ErrInvalidOutput    = errors.New("backend: output override must be absolute")
)

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Path      string `json:"path"`
	MediaType string `json:"mediaType"`
	Size      int64  `json:"size"`
	SHA256    string `json:"sha256,omitempty"`
}

type Capabilities

type Capabilities struct {
	Kind            string      `json:"kind"`
	ProtocolVersion int         `json:"protocolVersion"`
	Name            string      `json:"name"`
	Version         string      `json:"version"`
	Operations      []Operation `json:"operations"`
	Profiles        []string    `json:"profiles"`
	Features        []string    `json:"features,omitempty"`
}

type Compiler

type Compiler struct {
	Path    string `json:"path"`
	Version string `json:"version,omitempty"`
	SHA256  string `json:"sha256,omitempty"`
}

type Identity

type Identity struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type Operation

type Operation string
const (
	Restore Operation = "restore"
	Build   Operation = "build"
	Run     Operation = "run"
)

func (Operation) IsValid

func (o Operation) IsValid() bool

type Process

type Process struct {
	ExitCode  *int   `json:"exitCode,omitempty"`
	Stdout    string `json:"stdout,omitempty"`
	Stderr    string `json:"stderr,omitempty"`
	Truncated bool   `json:"truncated,omitempty"`
}

type Request

type Request struct {
	Kind          string            `json:"kind"`
	SchemaVersion int               `json:"schemaVersion"`
	Operation     Operation         `json:"operation"`
	ProjectRoot   string            `json:"projectRoot"`
	Profile       string            `json:"profile"`
	Target        string            `json:"target"`
	Entry         string            `json:"entry,omitempty"`
	Output        string            `json:"output,omitempty"`
	IncludePaths  []string          `json:"includePaths"`
	Defines       map[string]string `json:"defines"`
	Compiler      *Compiler         `json:"compiler,omitempty"`
	Arguments     []string          `json:"arguments"`
}

type RequestOptions

type RequestOptions struct {
	Compiler *Compiler
	Output   string
}

type Result

type Result struct {
	Kind          string                `json:"kind"`
	SchemaVersion int                   `json:"schemaVersion"`
	Status        string                `json:"status"`
	Backend       Identity              `json:"backend"`
	Artifacts     []Artifact            `json:"artifacts"`
	Diagnostics   []protocol.Diagnostic `json:"diagnostics"`
	Process       *Process              `json:"process,omitempty"`
	Runtime       *Runtime              `json:"runtime,omitempty"`
}

type Runtime

type Runtime struct {
	Tier           string `json:"tier"`
	Implementation string `json:"implementation"`
	Version        string `json:"version,omitempty"`
}

Jump to

Keyboard shortcuts

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