database

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package database is a database interface to health authorities.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHealthAuthorityNotFound = errors.New("health authority not found")
)

Functions

This section is empty.

Types

type HealthAuthorityDB

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

HealthAuthorityDB allows for opreations against authorized health authorities for diagnosis signature verification.

func New

func New(db *database.DB) *HealthAuthorityDB

New creates a HealthAuthorityDB attached to a specific database driver.

func (*HealthAuthorityDB) AddHealthAuthority

func (db *HealthAuthorityDB) AddHealthAuthority(ctx context.Context, ha *model.HealthAuthority) error

AddHealthAuthority inserts a new HealthAuthority record into the database.

func (*HealthAuthorityDB) AddHealthAuthorityKey

func (db *HealthAuthorityDB) AddHealthAuthorityKey(ctx context.Context, ha *model.HealthAuthority, hak *model.HealthAuthorityKey) error

func (*HealthAuthorityDB) GetHealthAuthority

func (db *HealthAuthorityDB) GetHealthAuthority(ctx context.Context, issuer string) (*model.HealthAuthority, error)

GetHealthAuthority retrieves a HealthAuthority record by the issuer name.

func (*HealthAuthorityDB) GetHealthAuthorityByID

func (db *HealthAuthorityDB) GetHealthAuthorityByID(ctx context.Context, id int64) (*model.HealthAuthority, error)

func (*HealthAuthorityDB) GetHealthAuthorityKeys

func (db *HealthAuthorityDB) GetHealthAuthorityKeys(ctx context.Context, ha *model.HealthAuthority) ([]*model.HealthAuthorityKey, error)

func (*HealthAuthorityDB) ListAllHealthAuthoritiesWithoutKeys

func (db *HealthAuthorityDB) ListAllHealthAuthoritiesWithoutKeys(ctx context.Context) ([]*model.HealthAuthority, error)

func (*HealthAuthorityDB) UpdateHealthAuthority

func (db *HealthAuthorityDB) UpdateHealthAuthority(ctx context.Context, ha *model.HealthAuthority) error

func (*HealthAuthorityDB) UpdateHealthAuthorityKey

func (db *HealthAuthorityDB) UpdateHealthAuthorityKey(ctx context.Context, hak *model.HealthAuthorityKey) error

Jump to

Keyboard shortcuts

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