pathstorage

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendKey    = "backend"
	ConnectionKey = "connection"
)

Variables

This section is empty.

Functions

func NewPathStorage

func NewPathStorage(pdbConf PathDBConf,
	rcConf RevCacheConf) (pathdb.PathDB, revcache.RevCache, error)

NewPathStorage creates a PathStorage from the given configs. Periodic cleaners for the given databases have to be manually created and started (see cleaner package).

Types

type Backend

type Backend string
const (
	BackendNone   Backend = ""
	BackendSqlite Backend = "sqlite"
	BackendMem    Backend = "mem"
)

type PathDBConf

type PathDBConf map[string]string

PathDBConf is the configuration for the connection to the path database.

func (*PathDBConf) Backend

func (cfg *PathDBConf) Backend() Backend

func (*PathDBConf) ConfigName

func (cfg *PathDBConf) ConfigName() string

func (*PathDBConf) Connection

func (cfg *PathDBConf) Connection() string

func (*PathDBConf) InitDefaults

func (cfg *PathDBConf) InitDefaults()

InitDefaults choses the sqlite backend if no backend is set.

func (*PathDBConf) MaxIdleConns

func (cfg *PathDBConf) MaxIdleConns() (int, bool)

func (*PathDBConf) MaxOpenConns

func (cfg *PathDBConf) MaxOpenConns() (int, bool)

func (*PathDBConf) Sample

func (cfg *PathDBConf) Sample(dst io.Writer, _ config.Path, ctx config.CtxMap)

func (*PathDBConf) Validate

func (cfg *PathDBConf) Validate() error

Validate validates the configuration, should be called after InitDefaults.

type RevCacheConf

type RevCacheConf map[string]string

RevCacheConf is the configuration for the connection to the revocation cache.

func (*RevCacheConf) Backend

func (cfg *RevCacheConf) Backend() Backend

func (*RevCacheConf) ConfigName

func (cfg *RevCacheConf) ConfigName() string

func (*RevCacheConf) Connection

func (cfg *RevCacheConf) Connection() string

func (*RevCacheConf) InitDefaults

func (cfg *RevCacheConf) InitDefaults()

InitDefaults chooses the in-memory backend if no backend is set.

func (*RevCacheConf) MaxIdleConns

func (cfg *RevCacheConf) MaxIdleConns() (int, bool)

func (*RevCacheConf) MaxOpenConns

func (cfg *RevCacheConf) MaxOpenConns() (int, bool)

func (*RevCacheConf) Sample

func (cfg *RevCacheConf) Sample(dst io.Writer, _ config.Path, _ config.CtxMap)

func (*RevCacheConf) Validate

func (cfg *RevCacheConf) Validate() error

Validate validates the configuration, should be called after InitDefaults.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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