Documentation ¶
Index ¶
- func Client(ctx context.Context, address string) (*mongo.Client, error)
- func IsDuplicateError(err error) bool
- func IsNotFoundError(err error) bool
- type Collections
- type Config
- type Data
- func (d *Data) AddOne(ctx context.Context, data interface{}) error
- func (d *Data) Delete(ctx context.Context, id string) error
- func (d *Data) Get(ctx context.Context, id string, item interface{}) error
- func (d *Data) GetAll(ctx context.Context, items interface{}, filterMap map[string][]string, ...) error
- func (d *Data) Update(ctx context.Context, id string, item interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDuplicateError ¶
IsDuplicateError checks if an error is a duplacte index error
func IsNotFoundError ¶
IsNotFoundError checks if an error is no ducument error
Types ¶
type Collections ¶
type Collections struct { Projects string `json:"projects"` Scenarios string `json:"scenarios"` TestPlans string `json:"testplans"` Executions string `json:"executions"` }
Collections represent the various collections in the store
func (Collections) Validate ¶
func (c Collections) Validate() error
Validate if all collections have been passed
type Config ¶
type Config struct { Address string `json:"address"` DataBase string `json:"database"` Collections Collections `json:"collections"` }
Config represents the Store coonection information
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data is used to manipulate the collections
func Collection ¶
func Collection(dbName, collectionName string, client *mongo.Client, constraints []string) (*Data, error)
Collection creates a collection object for the DB
Click to show internal directories.
Click to hide internal directories.