db

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoStatisticsFound = errors.New("no statistics found")

ErrNoStatisticsFound godoc

Functions

This section is empty.

Types

type HexID

type HexID struct {
	ID primitive.ObjectID `bson:"_id"`
}

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator goes through each and every document and escapes keys which are known to dots (".") https://github.com/keptn/keptn/issues/6250

func NewMigrator

func NewMigrator(batchSize int, interval time.Duration) *Migrator

NewMigrator creates a new instance of a Migrator

func (*Migrator) Run

func (m *Migrator) Run(ctx context.Context) (uint, error)

type MongoDBConnection

type MongoDBConnection struct {
	Client *mongo.Client
}

MongoDBConnection takes care of establishing a connection to the mongodb

func (*MongoDBConnection) EnsureDBConnection

func (m *MongoDBConnection) EnsureDBConnection() error

EnsureDBConnection makes sure a connection to the mongodb is established

type StatisticsMongoDBRepo

type StatisticsMongoDBRepo struct {
	DbConnection MongoDBConnection
	// contains filtered or unexported fields
}

StatisticsMongoDBRepo godoc

func (*StatisticsMongoDBRepo) DeleteStatistics

func (s *StatisticsMongoDBRepo) DeleteStatistics(from, to time.Time) error

func (*StatisticsMongoDBRepo) GetStatistics

func (s *StatisticsMongoDBRepo) GetStatistics(from, to time.Time) ([]operations.Statistics, error)

GetStatistics godoc

func (*StatisticsMongoDBRepo) StoreStatistics

func (s *StatisticsMongoDBRepo) StoreStatistics(statistics operations.Statistics) error

StoreStatistics godoc

type StatisticsRepo

type StatisticsRepo interface {
	// GetStatistics godoc
	GetStatistics(from, to time.Time) ([]operations.Statistics, error)
	// StoreStatistics godoc
	StoreStatistics(statistics operations.Statistics) error
	// DeleteStatistics godoc
	DeleteStatistics(from, to time.Time) error
}

StatisticsRepo godoc

Jump to

Keyboard shortcuts

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