database

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection Contains database connection pool.

var Database Connection

Database Singleton connection to EFGS database.

func (Connection) GetNotUploadedDiagnosisKeys

func (db Connection) GetNotUploadedDiagnosisKeys(dateUntil time.Time) ([]*efgsapi.DiagnosisKeyWrapper, error)

GetNotUploadedDiagnosisKeys Get keys from the DB that are not older than dateUntil and NOT IN EFGS.

func (Connection) PersistDiagnosisKeys

func (db Connection) PersistDiagnosisKeys(keys []*efgsapi.DiagnosisKey) error

PersistDiagnosisKeys Save array of DiagnosisKey to database.

func (Connection) RemoveDiagnosisKeys

func (db Connection) RemoveDiagnosisKeys(keys []*efgsapi.DiagnosisKeyWrapper) error

RemoveDiagnosisKeys Remove array of DiagnosisKeyWrapper from the DB.

func (Connection) RemoveInvalidKeys

func (db Connection) RemoveInvalidKeys() error

RemoveInvalidKeys Remove N times refused keys from the DB

func (Connection) RemoveOldKeys

func (db Connection) RemoveOldKeys(dateFrom string) error

RemoveOldKeys Removes keys older than date provided as parameter.

func (Connection) UpdateKeys

func (db Connection) UpdateKeys(keys []*efgsapi.DiagnosisKeyWrapper) error

UpdateKeys Updates key records in the DB.

Jump to

Keyboard shortcuts

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