mongocertstore

package
v5.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertCache

type CertCache struct {
	Collection database.Collection
	DB         database.Database
}

CertCache implements the autocert Cache interface and provides the ability to store SSL certs in the MongoDB. TODO: Add ability to mock Collection

func NewCertCache

func NewCertCache(db database.Database, collectionName string) *CertCache

NewCertCache creates a new SSL certificate cache in a MongoDB collection

func (*CertCache) Delete

func (cc *CertCache) Delete(ctx context.Context, key string) error

Delete removes a certificate from the database. The cert to remove is identified by a key

func (*CertCache) Get

func (cc *CertCache) Get(ctx context.Context, key string) ([]byte, error)

Get retrieves a certificate by key

func (*CertCache) Put

func (cc *CertCache) Put(ctx context.Context, key string, data []byte) error

Put inserts a certificate into the database

type CertCacheItem

type CertCacheItem struct {
	Certificate        []byte    `json:"certificate" bson:"certificate"`
	DateTimeCreatedUTC time.Time `json:"dateTimeCreatedUTC" bson:"dateTimeCreatedUTC"`
	Key                string    `json:"key" bson:"key"`
}

Jump to

Keyboard shortcuts

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