postgresrootkeystore

package
Version: v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: LGPL-3.0 Imports: 9 Imported by: 3

Documentation

Overview

Package postgreskeystore provides an implementation of bakery.RootKeyStore that uses Postgres as a persistent store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy dbrootkeystore.Policy

Policy holds a store policy for root keys.

type RootKeys

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

RootKeys represents a cache of macaroon root keys.

func NewRootKeys

func NewRootKeys(db *sql.DB, table string, maxCacheSize int) *RootKeys

NewRootKeys returns a root-keys cache that uses the given table in the given Postgres database for storage and is limited in size to approximately the given size. The table will be created lazily when the root key store is first used.

The returned RootKeys instance must be closed after use.

It also creates other SQL resources using the table name as a prefix.

Use the NewStore method to obtain a RootKeyStore implementation suitable for particular root key lifetimes.

func (*RootKeys) Close

func (s *RootKeys) Close() error

Close closes the RootKeys instance. This must be called after using the instance.

func (*RootKeys) NewStore

func (s *RootKeys) NewStore(policy Policy) bakery.RootKeyStore

NewStore returns a new RootKeyStore implementation that stores and obtains root keys from the given collection.

Root keys will be generated and stored following the given store policy.

It is expected that all collections passed to a given Store's NewStore method should refer to the same underlying collection.

Source Files

Jump to

Keyboard shortcuts

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