Documentation ¶
Index ¶
- type Database
- func (db *Database) AddReport(ctx context.Context, report *proto.Report) error
- func (db *Database) Close()
- func (db *Database) CreateAuthorizationKey(ctx context.Context, request *proto.TokenRequest) ([]byte, error)
- func (db *Database) GetDiagnosisKeys(ctx context.Context, request *proto.GetKeyRequest) (chan *proto.TimestampedTEK, chan error)
- func (db *Database) RunAsTransaction(ctx context.Context, f func(txn pgx.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database object providing pooled connections to the underlying postgres database
func NewFromConfig ¶
Creates a new Database instance from the given configuration
func NewWithInsecureDefaults ¶
Creates a new Database instance from the insecure defaults given in the docker compose file. Helpful for testing.
func (*Database) CreateAuthorizationKey ¶
func (db *Database) CreateAuthorizationKey(ctx context.Context, request *proto.TokenRequest) ([]byte, error)
Create a one-time use authorization key to be given to a patient.
func (*Database) GetDiagnosisKeys ¶
func (db *Database) GetDiagnosisKeys(ctx context.Context, request *proto.GetKeyRequest) (chan *proto.TimestampedTEK, chan error)
Click to show internal directories.
Click to hide internal directories.