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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRepo

type EventRepo interface {
	InsertEvent(event keptnapi.KeptnContextExtendedCE) error
	DropProjectCollections(event keptnapi.KeptnContextExtendedCE) error
	GetEvents(params event.GetEventsParams) (*EventsResult, error)
	GetEventsByType(params event.GetEventsByTypeParams) (*EventsResult, error)
}

type EventsResult

type EventsResult struct {
	// Events
	Events []keptnapi.KeptnContextExtendedCE `json:"events"`
	// Pointer to the next page
	NextPageKey string `json:"nextPageKey,omitempty"`
	// Size of the returned page
	PageSize int64 `json:"pageSize,omitempty"`
	// Total number of events
	TotalCount int64 `json:"totalCount,omitempty"`
}

type MongoDBConnection

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

MongoDBConnection takes care of establishing a connection to the mongodb

func GetMongoDBConnectionInstance

func GetMongoDBConnectionInstance() *MongoDBConnection

func (*MongoDBConnection) EnsureDBConnection

func (m *MongoDBConnection) EnsureDBConnection() error

EnsureDBConnection makes sure a connection to the mongodb is established

func (*MongoDBConnection) GetClient

func (m *MongoDBConnection) GetClient() (*mongo.Client, error)

type MongoDBEventRepo

type MongoDBEventRepo struct {
	DBConnection *MongoDBConnection
	// contains filtered or unexported fields
}

func NewMongoDBEventRepo

func NewMongoDBEventRepo(dbConnection *MongoDBConnection) *MongoDBEventRepo

func (*MongoDBEventRepo) DropProjectCollections

func (mr *MongoDBEventRepo) DropProjectCollections(event keptnapi.KeptnContextExtendedCE) error

func (*MongoDBEventRepo) GetEvents

func (mr *MongoDBEventRepo) GetEvents(params event.GetEventsParams) (*EventsResult, error)

func (*MongoDBEventRepo) GetEventsByType

func (mr *MongoDBEventRepo) GetEventsByType(params event.GetEventsByTypeParams) (*EventsResult, error)

func (*MongoDBEventRepo) InsertEvent

func (mr *MongoDBEventRepo) InsertEvent(event keptnapi.KeptnContextExtendedCE) error

Jump to

Keyboard shortcuts

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