Documentation ¶
Index ¶
- Constants
- type MongoRepository
- func (r *MongoRepository) Get(ctx context.Context, id string) (result testkube.Execution, err error)
- func (r *MongoRepository) GetByNameAndScript(ctx context.Context, name, script string) (result testkube.Execution, err error)
- func (r *MongoRepository) GetExecutions(ctx context.Context, id string) (result []testkube.Execution, err error)
- func (r *MongoRepository) GetNewestExecutions(ctx context.Context, limit int) (result []testkube.Execution, err error)
- func (r *MongoRepository) Insert(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 = "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) GetByNameAndScript ¶
func (*MongoRepository) GetExecutions ¶
func (*MongoRepository) GetNewestExecutions ¶
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 }
Click to show internal directories.
Click to hide internal directories.