Documentation ¶
Index ¶
- Constants
- type MongoRepository
- func (r *MongoRepository) Get(ctx context.Context) (result testkube.Config, err error)
- func (r *MongoRepository) GetTelemetryEnabled(ctx context.Context) (ok bool, err error)
- func (r *MongoRepository) GetUniqueClusterId(ctx context.Context) (clusterId string, err error)
- func (r *MongoRepository) Upsert(ctx context.Context, result testkube.Config) (err error)
- type Opt
- type Repository
Constants ¶
View Source
const CollectionName = "config"
View Source
const Id = "api"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoRepository ¶
type MongoRepository struct {
Coll *mongo.Collection
}
func NewMongoRepository ¶ added in v1.8.36
func NewMongoRepository(db *mongo.Database, opts ...Opt) *MongoRepository
func (*MongoRepository) GetTelemetryEnabled ¶
func (r *MongoRepository) GetTelemetryEnabled(ctx context.Context) (ok bool, err error)
func (*MongoRepository) GetUniqueClusterId ¶
func (r *MongoRepository) GetUniqueClusterId(ctx context.Context) (clusterId string, err error)
type Opt ¶ added in v1.8.36
type Opt func(*MongoRepository)
func WithCollection ¶ added in v1.8.36
func WithCollection(collection *mongo.Collection) Opt
type Repository ¶
type Repository interface { // GetUniqueClusterId gets unique cluster based ID GetUniqueClusterId(ctx context.Context) (string, error) // GetTelemetryEnabled get telemetry enabled GetTelemetryEnabled(ctx context.Context) (ok bool, err error) // Get gets execution result by id Get(ctx context.Context) (testkube.Config, error) // Upserts inserts record if not exists, updates otherwise Upsert(ctx context.Context, config testkube.Config) (testkube.Config, error) }
Click to show internal directories.
Click to hide internal directories.