Documentation ¶
Index ¶
- type AggregatedEnvironments
- type Environment
- type EnvironmentType
- type Operator
- func (e *Operator) GetAggregateEnvironments(pipeline mongo.Pipeline) (*mongo.Cursor, error)
- func (e *Operator) GetEnvironment(query bson.D) (Environment, error)
- func (e *Operator) GetEnvironmentDetails(ctx context.Context, environmentID string, projectID string) (Environment, error)
- func (e *Operator) GetEnvironmentWithProjectID(projectID string) ([]*Environment, error)
- func (e *Operator) GetEnvironments(ctx context.Context, query bson.D) ([]Environment, error)
- func (e *Operator) InsertEnvironment(ctx context.Context, environment Environment) error
- func (e *Operator) UpdateEnvironment(ctx context.Context, query bson.D, update bson.D) error
- type TotalFilteredData
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 ¶
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 ¶
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
type TotalFilteredData ¶
type TotalFilteredData struct {
Count int `bson:"count"`
}
Click to show internal directories.
Click to hide internal directories.