stores

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("certificate not found")

Functions

func Load

func Load()

Types

type Certificate

type Certificate struct {
	Domain          string `json:"domain" bson:"domain"`
	CertificateData []byte `json:"-" bson:"certificate"`
	PrivateKeyData  []byte `json:"-" bson:"private_key"`
	Issuer          string `json:"issuer" bson:"issuer"`
	ExpiresAt       int64  `json:"expires_at" bson:"expires_at"`
	CreatedAt       int64  `json:"created_at" bson:"created_at"`
}

type FileStore

type FileStore struct {
	Directory string
}

func NewFileStore

func NewFileStore() FileStore

func (FileStore) AddCertificate

func (store FileStore) AddCertificate(domain string, cert Certificate) error

func (FileStore) GetAllCertificates

func (store FileStore) GetAllCertificates(exp int64) []Certificate

func (FileStore) GetCertificate

func (store FileStore) GetCertificate(domain string) (*Certificate, error)

func (FileStore) Load

func (store FileStore) Load() error

func (FileStore) RemoveCertificate

func (store FileStore) RemoveCertificate(domain string) error

func (FileStore) UpdateCertificate

func (store FileStore) UpdateCertificate(domain string, cert Certificate) error

type MongoStore

type MongoStore struct {
	ConnectionString string
	DatabaseName     string
	// contains filtered or unexported fields
}

func NewMongoStore

func NewMongoStore() *MongoStore

func (MongoStore) AddCertificate

func (store MongoStore) AddCertificate(domain string, cert Certificate) error

func (MongoStore) GetAllCertificates

func (store MongoStore) GetAllCertificates(exp int64) []Certificate

func (MongoStore) GetCertificate

func (store MongoStore) GetCertificate(domain string) (*Certificate, error)

func (*MongoStore) Load

func (store *MongoStore) Load() error

func (MongoStore) RemoveCertificate

func (store MongoStore) RemoveCertificate(domain string) error

func (MongoStore) UpdateCertificate

func (store MongoStore) UpdateCertificate(domain string, cert Certificate) error

type SQLStore

type SQLStore struct {
	Driver     string
	DataSource string
	// contains filtered or unexported fields
}

func NewSQLStore

func NewSQLStore() *SQLStore

func (SQLStore) AddCertificate

func (store SQLStore) AddCertificate(domain string, cert Certificate) error

func (SQLStore) GetAllCertificates

func (store SQLStore) GetAllCertificates(exp int64) []Certificate

func (SQLStore) GetCertificate

func (store SQLStore) GetCertificate(domain string) (*Certificate, error)

func (*SQLStore) Load

func (store *SQLStore) Load() error

func (SQLStore) RemoveCertificate

func (store SQLStore) RemoveCertificate(domain string) error

func (SQLStore) UpdateCertificate

func (store SQLStore) UpdateCertificate(domain string, cert Certificate) error

type Store

type Store interface {
	Load() error
	AddCertificate(domain string, cert Certificate) error
	GetCertificate(domain string) (*Certificate, error)
	GetAllCertificates(exp int64) []Certificate
	UpdateCertificate(domain string, cert Certificate) error
	RemoveCertificate(domain string) error
}
var Active Store

Jump to

Keyboard shortcuts

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