backend

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package backend contains a fake fleet backend for use in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend is the fake fleet backend.

func New

func New(t func() *testing.T, host *environments.Host) *Backend

New creates a new Backend.

func (*Backend) Catalog

func (b *Backend) Catalog() *Catalog

Catalog returns the catalog.

func (*Backend) PromoteConfigExperiment

func (b *Backend) PromoteConfigExperiment() error

PromoteConfigExperiment promotes a config experiment for the given package.

func (*Backend) PromoteExperiment

func (b *Backend) PromoteExperiment(pkg string) error

PromoteExperiment promotes an update experiment for the given package.

func (*Backend) RemoteConfigStatus

func (b *Backend) RemoteConfigStatus() (RemoteConfigState, error)

RemoteConfigStatus returns the status of the remote config.

func (*Backend) RemoteConfigStatusPackage

func (b *Backend) RemoteConfigStatusPackage(packageName string) (RemoteConfigStatePackage, error)

RemoteConfigStatusPackage returns the status of the remote config for a given package.

func (*Backend) StartConfigExperiment

func (b *Backend) StartConfigExperiment(operations ConfigOperations) error

StartConfigExperiment starts a config experiment for the given package.

func (*Backend) StartExperiment

func (b *Backend) StartExperiment(pkg string, version string) error

StartExperiment starts an update experiment for the given package.

func (*Backend) StopConfigExperiment

func (b *Backend) StopConfigExperiment() error

StopConfigExperiment stops a config experiment for the given package.

func (*Backend) StopExperiment

func (b *Backend) StopExperiment(pkg string) error

StopExperiment stops an update experiment for the given package.

type Branch

type Branch string

Branch is the branch of the package.

const (
	// BranchStable is the stable branch of the package.
	BranchStable Branch = "stable"
	// BranchTesting is the testing branch of the package.
	BranchTesting Branch = "testing"
)

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is the catalog of available packages.

func (*Catalog) Latest

func (c *Catalog) Latest(branch Branch, pkg string) string

Latest returns the latest version for a given package and branch.

func (*Catalog) LatestMinus

func (c *Catalog) LatestMinus(branch Branch, pkg string, minus int) string

LatestMinus returns the version that is N versions behind the latest, for a given package and branch.

type ConfigOperations

type ConfigOperations struct {
	DeploymentID   string          `json:"deployment_id"`
	FileOperations []FileOperation `json:"file_operations"`
}

ConfigOperations is the list of operations to perform on the config.

type FileOperation

type FileOperation struct {
	FileOperationType FileOperationType `json:"file_op"`
	FilePath          string            `json:"file_path"`
	Patch             json.RawMessage   `json:"patch,omitempty"`
}

FileOperation is the operation to perform on a config.

type FileOperationType

type FileOperationType string

FileOperationType is the type of operation to perform on the config.

const (
	// FileOperationPatch patches the config at the given path with the given JSON patch (RFC 6902).
	FileOperationPatch FileOperationType = "patch"
	// FileOperationMergePatch merges the config at the given path with the given JSON merge patch (RFC 7396).
	FileOperationMergePatch FileOperationType = "merge-patch"
	// FileOperationDelete deletes the config at the given path.
	FileOperationDelete FileOperationType = "delete"
)

type RemoteConfigState

type RemoteConfigState struct {
	Packages []RemoteConfigStatePackage `json:"remote_config_state"`
}

RemoteConfigState is the state of the remote config.

type RemoteConfigStatePackage

type RemoteConfigStatePackage struct {
	Package                 string `json:"package"`
	StableVersion           string `json:"stable_version"`
	ExperimentVersion       string `json:"experiment_version"`
	StableConfigVersion     string `json:"stable_config_version"`
	ExperimentConfigVersion string `json:"experiment_config_version"`
}

RemoteConfigStatePackage is the state of a package in the remote config.

Jump to

Keyboard shortcuts

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