db

package
v0.0.0-...-2610577 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 2 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 a persistent storage for jwt keys.

func New

func New(db *sql.DB) *DB

New crates new DB.

func (*DB) Create

func (db *DB) Create(ctx context.Context, key *PublicKey) error

Create adds a key to the db.

func (*DB) Delete

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

Delete deletes key by id.

func (*DB) Get

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

Get returns key by id.

func (*DB) List

func (db *DB) List(ctx context.Context) ([]*PublicKey, error)

List returns all keys.

type PublicKey

type PublicKey struct {
	ID        string
	DerBase64 string
}

PublicKey is a public key.

Jump to

Keyboard shortcuts

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