Documentation ¶
Index ¶
- Constants
- type MongoRepository
- func (r *MongoRepository) Get(ctx context.Context, id string) (result testkube.Execution, err error)
- func (r *MongoRepository) Insert(ctx context.Context, result testkube.Execution) (err error)
- func (r *MongoRepository) QueuePull(ctx context.Context) (result testkube.Execution, err error)
- func (r *MongoRepository) Update(ctx context.Context, result testkube.Execution) (err error)
- func (r *MongoRepository) UpdateResult(ctx context.Context, id string, result testkube.ExecutionResult) (err error)
- type Repository
Constants ¶
View Source
const CollectionName = "executions"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoRepository ¶
type MongoRepository struct {
Coll *mongo.Collection
}
func NewMongoRespository ¶
func NewMongoRespository(db *mongo.Database, collection string) *MongoRepository
NewMongoRespository creates new result repository with db setup for given collection use empty collection name as param for default "executions" collection name
func (*MongoRepository) UpdateResult ¶
func (r *MongoRepository) UpdateResult(ctx context.Context, id string, result testkube.ExecutionResult) (err error)
type Repository ¶
type Repository interface { // Get gets execution result by id Get(ctx context.Context, id string) (testkube.Execution, error) // Insert inserts new execution result Insert(ctx context.Context, result testkube.Execution) error // Update updates execution result Update(ctx context.Context, result testkube.Execution) error //UpdateResult updates only result part of execution UpdateResult(ctx context.Context, id string, result testkube.ExecutionResult) (err error) // QueuePull pulls from queue and locks other clients to read (changes state from queued->pending) QueuePull(ctx context.Context) (testkube.Execution, error) }
Repository represent execution result repository TODO try to merge both repositories into one
Click to show internal directories.
Click to hide internal directories.