planmock

package
v1.2.30 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

Generate creates a DeploymentGetResponse to mock the plan tracker. See the configuration options in the GenerateConfig struct.

func NewPlanStep

func NewPlanStep(name, status string) *models.ClusterPlanStepInfo

NewPlanStep creates a new plan step with the specified fields.

func NewPlanStepLog

func NewPlanStepLog(l ...*models.ClusterPlanStepInfo) []*models.ClusterPlanStepInfo

NewPlanStepLog combines a list of models.ClusterPlanStepInfo into a slice.

func NewPlanStepWithDetailsAndError

func NewPlanStepWithDetailsAndError(name string, details []*models.ClusterPlanStepLogMessageInfo) *models.ClusterPlanStepInfo

NewPlanStepWithDetailsAndError creates a new plan step with the specified fields with an error status.

Types

type GenerateConfig

type GenerateConfig struct {
	// If omitted, a random ID will be auto-generated.
	ID string

	Elasticsearch      []GeneratedResourceConfig
	EnterpriseSearch   []GeneratedResourceConfig
	Kibana             []GeneratedResourceConfig
	Apm                []GeneratedResourceConfig
	IntegrationsServer []GeneratedResourceConfig
	Appsearch          []GeneratedResourceConfig
}

GenerateConfig is a helper used to create a DeploymentGetResponse to be used for tests. It provides a generic implementation so all deployment resoource types can be generated a plan log and tracked.

type GeneratedResourceConfig

type GeneratedResourceConfig struct {
	// If omitted, a random ID will be auto-generated.
	ID string

	// If omitted, it'll default to "main-<kind>"
	RefID string

	// Current plan logs.
	CurrentLog []*models.ClusterPlanStepInfo

	// Pending plan logs.
	PendingLog []*models.ClusterPlanStepInfo

	// Histoory plan logs.
	HistoryLog []*models.ClusterPlanStepInfo
}

GeneratedResourceConfig is used to construct a deployment resource plan with the plan log steps specified.

Jump to

Keyboard shortcuts

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