result

package
v0.5.56 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CollectionName = "results"

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) *MongoRepository

func (*MongoRepository) Get

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

func (*MongoRepository) GetByNameAndScript

func (r *MongoRepository) GetByNameAndScript(ctx context.Context, name, script string) (result testkube.Execution, err error)

func (*MongoRepository) GetExecutions

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

func (*MongoRepository) GetNewestExecutions

func (r *MongoRepository) GetNewestExecutions(ctx context.Context, limit int) (result []testkube.Execution, err error)

func (*MongoRepository) Insert

func (r *MongoRepository) Insert(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)
	// GetByName gets execution result by name
	GetByNameAndScript(ctx context.Context, name, script string) (testkube.Execution, error)
	// GetNewestExecutions gets top X newest executions
	GetNewestExecutions(ctx context.Context, limit int) ([]testkube.Execution, error)
	// GetExecutions gets executions for given script ID
	GetExecutions(ctx context.Context, scriptID 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
	// UpdateExecution updates result in execution
	UpdateResult(ctx context.Context, id string, execution testkube.ExecutionResult) error
}

Jump to

Keyboard shortcuts

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