Documentation ¶
Overview ¶
Package badgerstorage implements certmagic.Storage on top of a Badger database.
It's an alternative to the default file-system storage used by CertMagic.
Example ¶
// setup the badger DB db, err := badger.Open(badger.DefaultOptions("").WithInMemory(true)) if err != nil { log.Fatalf("Cannot open badger memory DB: %s", err) } // set the default CertMagic storage to replace the file-system based on. certmagic.Default.Storage = New(db) // setup the rest of your CertMagic stuff...
Output:
Index ¶
- type Storage
- func (sto *Storage) Delete(key string) error
- func (sto *Storage) Exists(key string) bool
- func (sto *Storage) List(prefix string, recursive bool) ([]string, error)
- func (sto *Storage) Load(key string) ([]byte, error)
- func (sto *Storage) Lock(key string) error
- func (sto *Storage) Stat(key string) (certmagic.KeyInfo, error)
- func (sto *Storage) Store(key string, value []byte) error
- func (sto *Storage) Unlock(key string) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct { // DB is the underlying badger database DB *badger.DB // contains filtered or unexported fields }
Storage implements certmagic.Storage
func New ¶
func New(db *badger.DB) *Storage
New return a new Storage using db to store persisted data.
func (*Storage) Delete ¶
Delete implements certmagic.Storage.Delete
func (*Storage) Exists ¶
Exists implements certmagic.Storage.Exists
func (*Storage) List ¶
List implements certmagic.Storage.List
func (*Storage) Load ¶
Load implements certmagic.Storage.Load
func (*Storage) Lock ¶
Lock implements certmagic.Storage.Lock
func (*Storage) Stat ¶
Stat implements certmagic.Storage.Stat
func (*Storage) Store ¶
Store implements certmagic.Storage.Store
Click to show internal directories.
Click to hide internal directories.