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



    This section is empty.


    This section is empty.


    This section is empty.


    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