postgres

package
v0.0.0-...-95e6a1e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is an implemntation of the db.DB interface

func (*DB) AddKey

func (p *DB) AddKey(k *secrets.Key) error

AddKey inserts a key into the DB

func (*DB) AddSecret

func (p *DB) AddSecret(s *secrets.Secret) error

AddSecret inserts a new secret into the DB

func (*DB) Connect

func (p *DB) Connect() (err error)

Connect connects to the database using env vars. After connect, it creates tables if missing.

func (*DB) DeleteKey

func (p *DB) DeleteKey(k *secrets.Key) (err error)

DeleteKey removes a key from the DB

func (*DB) DeleteSecret

func (p *DB) DeleteSecret(s *secrets.Secret) (err error)

DeleteSecret removes a secret from the DB

func (*DB) GetKey

func (p *DB) GetKey(k *secrets.Key) error

GetKey selects a key from the database based on values provided in k.

func (*DB) GetRootSecret

func (p *DB) GetRootSecret(s *secrets.Secret) error

GetRootSecret returns the latest matching root secret

func (*DB) GetSharedSecret

func (p *DB) GetSharedSecret(s *secrets.Secret, k *secrets.Key) error

GetSharedSecret returns the shared cert linking s and k

func (*DB) ListKeys

func (p *DB) ListKeys(secret *string) func(int) ([]secrets.Key, error)

ListKeys returns an iterator function that walks through all keys in the database. The iterator takes an integer argument, which is the maximum number of results to return per iteration. If a secret name is specified, the results are limited to keys with access to that secret.

func (*DB) ListSecrets

func (p *DB) ListSecrets(key *string) func(int) ([]secrets.Secret, error)

ListSecrets returns an iterator function that walks through all secrets in the database. The iterator takes an integer argument, which is the maximum number of results to return per iteration. If a key name is specified, the results are limited to secrets shared with that key.

func (*DB) Metrics

func (p *DB) Metrics() (map[string]interface{}, error)

Metrics returns data about the state of the database

func (*DB) Ping

func (p *DB) Ping() (err error)

Ping checks that the database is connected

func (*DB) UpdateSecret

func (p *DB) UpdateSecret(s *secrets.Secret) error

UpdateSecret updates a secret by adding a new copy of it to the db.

Jump to

Keyboard shortcuts

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