Skip to content

Package oya.to/certmagic-badgerstorage implements certmagic.Storage on top of a badger database.

License

Notifications You must be signed in to change notification settings

oyato/certmagic-badgerstorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

certmagic-badgerstorage

Package badgerstorage implements a certmagic.Storage on top of a Badger database.

It's an alternative to the default file-system storage used by CertMagic.

Install

go get oya.to/certmagic-badgerstorage

Usage

package main

import (
	"github.com/caddyserver/certmagic"
	"github.com/dgraph-io/badger/v2"
	"log"
	"oya.to/certmagic-badgerstorage"
)

func main() {
	// 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 = badgerstorage.New(db)

	// setup the rest of your CertMagic stuff...
}

About

Package oya.to/certmagic-badgerstorage implements certmagic.Storage on top of a badger database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages