nosql

package
v0.25.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct{}

Clock that returns time in UTC rounded to seconds.

func (*Clock) Now

func (c *Clock) Now() time.Time

Now returns the UTC time rounded to seconds.

type DB

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

DB is a struct that implements the AdminDB interface.

func New

func New(db nosqlDB.DB, authorityID string) (*DB, error)

New configures and returns a new Authority DB backend implemented using a nosql DB.

func (*DB) CreateAdmin

func (db *DB) CreateAdmin(ctx context.Context, adm *linkedca.Admin) error

CreateAdmin stores a new admin to the database.

func (*DB) CreateAuthorityPolicy added in v0.20.0

func (db *DB) CreateAuthorityPolicy(ctx context.Context, policy *linkedca.Policy) error

func (*DB) CreateProvisioner

func (db *DB) CreateProvisioner(ctx context.Context, prov *linkedca.Provisioner) error

CreateProvisioner stores a new provisioner to the database.

func (*DB) DeleteAdmin

func (db *DB) DeleteAdmin(ctx context.Context, id string) error

DeleteAdmin saves an updated admin to the database.

func (*DB) DeleteAuthorityPolicy added in v0.20.0

func (db *DB) DeleteAuthorityPolicy(ctx context.Context) error

func (*DB) DeleteProvisioner

func (db *DB) DeleteProvisioner(ctx context.Context, id string) error

DeleteProvisioner saves an updated admin to the database.

func (*DB) GetAdmin

func (db *DB) GetAdmin(ctx context.Context, id string) (*linkedca.Admin, error)

GetAdmin retrieves and unmarshals a admin from the database.

func (*DB) GetAdmins

func (db *DB) GetAdmins(context.Context) ([]*linkedca.Admin, error)

GetAdmins retrieves and unmarshals all active (not deleted) admins from the database. TODO should we be paginating?

func (*DB) GetAuthorityPolicy added in v0.20.0

func (db *DB) GetAuthorityPolicy(ctx context.Context) (*linkedca.Policy, error)

func (*DB) GetProvisioner

func (db *DB) GetProvisioner(ctx context.Context, id string) (*linkedca.Provisioner, error)

GetProvisioner retrieves and unmarshals a provisioner from the database.

func (*DB) GetProvisioners

func (db *DB) GetProvisioners(_ context.Context) ([]*linkedca.Provisioner, error)

GetProvisioners retrieves and unmarshals all active (not deleted) provisioners from the database.

func (*DB) UpdateAdmin

func (db *DB) UpdateAdmin(ctx context.Context, adm *linkedca.Admin) error

UpdateAdmin saves an updated admin to the database.

func (*DB) UpdateAuthorityPolicy added in v0.20.0

func (db *DB) UpdateAuthorityPolicy(ctx context.Context, policy *linkedca.Policy) error

func (*DB) UpdateProvisioner

func (db *DB) UpdateProvisioner(ctx context.Context, prov *linkedca.Provisioner) error

UpdateProvisioner saves an updated provisioner to the database.

Jump to

Keyboard shortcuts

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