config

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

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

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)

func (*MongoRepository) Upsert

func (r *MongoRepository) Upsert(ctx context.Context, result testkube.Config) (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)
}

Jump to

Keyboard shortcuts

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