Documentation
¶
Overview ¶
Package backend contains a fake fleet backend for use in tests.
Index ¶
- type Backend
- func (b *Backend) Catalog() *Catalog
- func (b *Backend) PromoteConfigExperiment() error
- func (b *Backend) PromoteExperiment(pkg string) error
- func (b *Backend) RemoteConfigStatus() (RemoteConfigState, error)
- func (b *Backend) RemoteConfigStatusPackage(packageName string) (RemoteConfigStatePackage, error)
- func (b *Backend) StartConfigExperiment(operations ConfigOperations) error
- func (b *Backend) StartExperiment(pkg string, version string) error
- func (b *Backend) StopConfigExperiment() error
- func (b *Backend) StopExperiment(pkg string) error
- type Branch
- type Catalog
- type ConfigOperations
- type FileOperation
- type FileOperationType
- type RemoteConfigState
- type RemoteConfigStatePackage
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 ¶
PromoteConfigExperiment promotes a config experiment for the given package.
func (*Backend) PromoteExperiment ¶
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 ¶
StartExperiment starts an update experiment for the given package.
func (*Backend) StopConfigExperiment ¶
StopConfigExperiment stops a config experiment for the given package.
func (*Backend) StopExperiment ¶
StopExperiment stops an update experiment for the given package.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is the catalog of available packages.
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.