environments

package
v0.0.0-...-bcdb799 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedEnvironments

type AggregatedEnvironments struct {
	TotalFilteredEnvironments []TotalFilteredData `bson:"total_filtered_environments"`
	Environments              []Environment       `bson:"environments"`
}

type Environment

type Environment struct {
	mongodb.Audit           `bson:",inline"`
	mongodb.ResourceDetails `bson:",inline"`
	ProjectID               string          `bson:"project_id"`
	EnvironmentID           string          `bson:"environment_id"`
	Type                    EnvironmentType `bson:"type"`
	InfraIDs                []string        `bson:"infra_ids"`
}

type EnvironmentType

type EnvironmentType string
const (
	Prod    EnvironmentType = "prod"
	NonProd EnvironmentType = "non_prod"
)

type Operator

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

func NewEnvironmentOperator

func NewEnvironmentOperator(mongodbOperator mongodb.MongoOperator) *Operator

NewEnvironmentOperator retuurns a new instance of operator

func (*Operator) GetAggregateEnvironments

func (e *Operator) GetAggregateEnvironments(pipeline mongo.Pipeline) (*mongo.Cursor, error)

GetAggregateEnvironments takes a mongo pipeline to retrieve the details from the database

func (*Operator) GetEnvironment

func (e *Operator) GetEnvironment(query bson.D) (Environment, error)

GetEnvironment takes a environmentID to retrieve the chaos_environment details from the database

func (*Operator) GetEnvironmentDetails

func (e *Operator) GetEnvironmentDetails(ctx context.Context, environmentID string, projectID string) (Environment, error)

GetEnvironmentDetails takes a environmentName and projectID to retrieve the chaos_environment details from the database

func (*Operator) GetEnvironmentWithProjectID

func (e *Operator) GetEnvironmentWithProjectID(projectID string) ([]*Environment, error)

GetEnvironmentWithProjectID takes projectID parameters to retrieve the chaos_environment details

func (*Operator) GetEnvironments

func (e *Operator) GetEnvironments(ctx context.Context, query bson.D) ([]Environment, error)

GetEnvironments returns all the environments matching the query

func (*Operator) InsertEnvironment

func (e *Operator) InsertEnvironment(ctx context.Context, environment Environment) error

InsertEnvironment takes details of a chaos_environment and inserts into the database collection

func (*Operator) UpdateEnvironment

func (e *Operator) UpdateEnvironment(ctx context.Context, query bson.D, update bson.D) error

UpdateEnvironment takes query and update parameters to update the chaos_environment details in the database

type TotalFilteredData

type TotalFilteredData struct {
	Count int `bson:"count"`
}

Jump to

Keyboard shortcuts

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