db

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Generic certificate database package

This provides functionality to read certificate configurations and generated content from any source.

At this point in time it's tailored to one-shot filesystem generation, but this will change, once other sources (like e.g. REST-APIs) are added.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConsistent

func IsConsistent(backend Database) bool

func Update

func Update(backend Database, strat UpdateStrategy) (int, error)

Types

type BuildArtifact

type BuildArtifact struct {
	Certificate *cert.Certificate
	PrivateKey  crypto.PrivateKey
	Request     *cert.CertificateRequest
}

type Database

type Database interface {
	Open() error
	Close() error

	PutEntity(DbEntity) error
	GetEntity(string) *DbEntity
	NumEntities() int

	RootEntities() []string
	GetSubscribers(string) []string

	AddProfile(config.CertificateProfile) error
	GetProfile(string) *config.CertificateProfile
}

type DbEntity

type DbEntity struct {
	LastBuild        time.Time
	Config           config.CertificateContent
	LastConfigUpdate time.Time
	BuildArtifact    BuildArtifact
}

type UpdateStrategy

type UpdateStrategy uint8
const (
	UpdateNone        UpdateStrategy = 0
	UpdateMissing     UpdateStrategy = 1
	UpdateExpired     UpdateStrategy = 2
	UpdateNewerConfig UpdateStrategy = 4
	UpdateAll         UpdateStrategy = 8
)

Directories

Path Synopsis
Database implementation for filesystems.
Database implementation for filesystems.

Jump to

Keyboard shortcuts

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