db

package
v0.0.0-...-cd871c7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoCrashTable

type MongoCrashTable struct {
	*MongoTable[backend.CrashReport]
	// contains filtered or unexported fields
}

func NewMongoCrashTable

func NewMongoCrashTable(crashCol *mongo.Collection, archiveCol *mongo.Collection) *MongoCrashTable

func (*MongoCrashTable) Archive

func (m *MongoCrashTable) Archive(ctx context.Context, toArchive backend.ArchivedCrash) error

func (*MongoCrashTable) InsertCrash

func (m *MongoCrashTable) InsertCrash(ctx context.Context, ind backend.IndividualCrash) error

func (*MongoCrashTable) IsArchived

func (m *MongoCrashTable) IsArchived(ctx context.Context, ind backend.IndividualCrash) bool

type MongoTable

type MongoTable[T backend.IDStruct] struct {
	// contains filtered or unexported fields
}

func NewMongoTable

func NewMongoTable[T backend.IDStruct](col *mongo.Collection) *MongoTable[T]

func (*MongoTable[CountLog]) Count

func (m *MongoTable[CountLog]) Count(ctx context.Context, platform string) (int, error)

func (*MongoTable[T]) Find

func (m *MongoTable[T]) Find(ctx context.Context, values map[string]any) ([]T, error)

func (*MongoTable[T]) FullUpdate

func (m *MongoTable[T]) FullUpdate(ctx context.Context, ID string, data T) error

func (*MongoTable[T]) Get

func (m *MongoTable[T]) Get(ctx context.Context, ID string) (data T, err error)

func (*MongoTable[T]) Insert

func (m *MongoTable[T]) Insert(ctx context.Context, data T) error

func (*MongoTable[T]) PartUpdate

func (m *MongoTable[T]) PartUpdate(ctx context.Context, ID string, update map[string]any) error

func (*MongoTable[T]) Remove

func (m *MongoTable[T]) Remove(ctx context.Context, ID string) error

func (*MongoTable[CountLog]) RemoveOldLogs

func (m *MongoTable[CountLog]) RemoveOldLogs(ctx context.Context, date int) error

Jump to

Keyboard shortcuts

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