nosql

package
v0.15.16-rc6 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 9 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 AcmeDB 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) 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) 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(ctx context.Context) ([]*linkedca.Admin, error)

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

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(ctx 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) 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