Back to godoc.org
gopkg.in/macaroon-bakery.v2 / bakery / mgorootkeystore

Package mgorootkeystore

v2.0.1
Latest Go to latest

The latest major version is v2.

Published: Mar 9, 2018 | License: LGPL-3.0 | Module: gopkg.in/macaroon-bakery.v2

Overview

Package mgorootkeystore provides an implementation of bakery.RootKeyStore that uses MongoDB as a persistent store.

Index

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(maxCacheSize int) *RootKeys

NewRootKeys returns a root-keys cache that is limited in size to approximately the given size.

The NewStore method returns a store implementation that uses a specific mongo collection and store policy.

func (*RootKeys) EnsureIndex

func (s *RootKeys) EnsureIndex(c *mgo.Collection) error

EnsureIndex ensures that the required indexes exist on the collection that will be used for root key store. This should be called at least once before using NewStore.

func (*RootKeys) NewStore

func (s *RootKeys) NewStore(c *mgo.Collection, 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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier