appsetup

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 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 appsetup defines the host contract for first-party app setup. Provider-specific setup policy belongs to the plugin that implements Runner.

Index

Constants

View Source
const (
	MutationUpdated             = "updated"
	MutationUnchanged           = "unchanged"
	MutationPartial             = "partial"
	MutationDurabilityUncertain = "durability_uncertain"
)

Variables

View Source
var ErrSecretNotFound = errors.New("app setup secret not found")

ErrSecretNotFound lets the host hide its secret-store implementation.

Functions

func Failure

func Failure(kind Kind, message string) error

Failure constructs a classified, public-safe setup error.

Types

type AppStatus

type AppStatus struct {
	AppID             string
	PluginID          string
	RuntimeGeneration uint64
}

AppStatus contains only the runtime identity needed to reject stale setup.

type ConfigResult

type ConfigResult struct {
	Status     string
	AppID      string
	Generation uint64
}

ConfigResult is the provider-independent result of replacing app configuration.

type Configuration

type Configuration struct {
	Config               []byte
	Secrets              map[string]string
	Policies             map[string]presentation.PolicyConfig
	LaunchAction         string
	LaunchActionProvided bool
}

Configuration is the validated app configuration envelope supplied by the CLI.

type Error

type Error struct {
	Kind    Kind
	Message string
}

Error is a public-safe setup failure.

func (*Error) Error

func (err *Error) Error() string

type Host

type Host interface {
	ReadConfiguration(string, io.Reader) (Configuration, error)
	LoadDocument() (config.Document, error)
	DaemonStatus(context.Context) (Status, error)
	ResolveSecret(context.Context, string) (string, error)
	StoreSecret(context.Context, string, string) error
	ReplaceConfiguration(context.Context, ReplaceConfigRequest) Mutation
}

Host provides setup implementations with generic configuration and secret operations. It contains no provider policy.

type Kind

type Kind uint8

Kind classifies a setup failure without coupling plugins to CLI exit codes.

const (
	Usage Kind = iota + 1
	Rejected
	Operational
	Partial
)

type Mutation

type Mutation struct {
	Result       ConfigResult
	Outcome      MutationOutcome
	CloseWarning bool
	Err          error
}

Mutation is the host's observation of one configuration transaction.

type MutationOutcome

type MutationOutcome uint8

MutationOutcome records whether a missing daemon response can still have committed the requested configuration.

const (
	MutationKnown MutationOutcome = iota
	MutationUnknown
)

type ReplaceConfigRequest

type ReplaceConfigRequest struct {
	AppID              string
	ExpectedGeneration uint64
	Config             []byte
	Secrets            map[string]string
	Policies           map[string]presentation.PolicyConfig
	LaunchAction       string
}

ReplaceConfigRequest contains the complete generic app transaction.

type Runner

type Runner func(context.Context, []string, io.Reader, io.Writer, io.Writer, Host) error

Runner owns one plugin's setup syntax and policy.

type Status

type Status struct {
	Generation uint64
	Apps       []AppStatus
}

Status is the daemon state needed to preflight an app setup transaction.

Jump to

Keyboard shortcuts

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