result

package
v0.5.42 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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) Get

func (r *MongoRepository) Get(ctx context.Context, id string) (result testkube.Execution, err error)

func (*MongoRepository) Insert

func (r *MongoRepository) Insert(ctx context.Context, result testkube.Execution) (err error)

func (*MongoRepository) QueuePull

func (r *MongoRepository) QueuePull(ctx context.Context) (result testkube.Execution, err error)

func (*MongoRepository) Update

func (r *MongoRepository) Update(ctx context.Context, result testkube.Execution) (err error)

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

Jump to

Keyboard shortcuts

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