fleetbackend

package
v0.73.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fleetbackend 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) PromoteConfigExperiment

func (b *Backend) PromoteConfigExperiment() error

PromoteConfigExperiment promotes a config 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) StopConfigExperiment

func (b *Backend) StopConfigExperiment() error

StopConfigExperiment stops a config experiment for the given package.

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