resourceapply

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resourceapply checks and converges declarative SecondBox resources.

Index

Constants

View Source
const SchemaVersion = "secondbox.resources/v1"

Variables

This section is empty.

Functions

func Encode

func Encode(document Document) ([]byte, error)

Types

type Action

type Action string
const (
	ActionCreate Action = "create"
	ActionUpdate Action = "update"
	ActionAppend Action = "append"
	ActionNoop   Action = "noop"
)

type Document

type Document struct {
	SchemaVersion string       `json:"schemaVersion"`
	RunnerPools   []RunnerPool `json:"runnerPools"`
	Profiles      []Profile    `json:"profiles"`
}

Document is a non-secret desired-state document. Absence never means delete.

func Decode

func Decode(data []byte) (Document, error)

func (Document) Validate

func (document Document) Validate() error

type Profile

type Profile struct {
	Name      string            `json:"name"`
	Revisions []ProfileRevision `json:"revisions"`
}

type ProfileRevision

type ProfileRevision struct {
	Number     int64                               `json:"number"`
	SpecDigest string                              `json:"specDigest"`
	Spec       secondboxclient.ProfileRevisionSpec `json:"spec"`
}

type Report

type Report struct {
	SchemaVersion string   `json:"schemaVersion"`
	Applied       bool     `json:"applied"`
	Results       []Result `json:"results"`
}

func Apply

func Apply(ctx context.Context, client Client, document Document) (Report, error)

func Check

func Check(ctx context.Context, client Client, document Document) (Report, error)

type Result

type Result struct {
	Kind         string `json:"kind"`
	Name         string `json:"name"`
	Action       Action `json:"action"`
	FromRevision int64  `json:"fromRevision,omitempty"`
	ToRevision   int64  `json:"toRevision,omitempty"`
}

type RunnerPool

type RunnerPool struct {
	Name          string                                 `json:"name"`
	Architectures secondboxclient.RunnerArchitectureList `json:"architectures"`
	Capabilities  secondboxclient.RunnerCapabilityList   `json:"capabilities"`
	State         secondboxclient.RunnerPoolState        `json:"state"`
	MutableFields []string                               `json:"mutableFields"`
}

Jump to

Keyboard shortcuts

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