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)

              ListAllHealthAuthoritiesWithoutKeys retrieves all known health authorities in the system. Support function for admin console.

              func (*HealthAuthorityDB) PurgeHealthAuthorityKeys

              func (db *HealthAuthorityDB) PurgeHealthAuthorityKeys(ctx context.Context, ha *model.HealthAuthority, purgeBefore time.Time) (int64, error)

              func (*HealthAuthorityDB) UpdateHealthAuthority

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

                UpdateHealthAuthority updates the database record for the specified health authority.

                func (*HealthAuthorityDB) UpdateHealthAuthorityKey

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