truststorage

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package truststorage provides a "factory" for trust database. A config containing the backend type and the connection string are used to create a specific trust db.

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

type TrustDBConf

type TrustDBConf map[string]string

TrustDBConf is the configuration for the connection to the trust database.

func (*TrustDBConf) Backend

func (cfg *TrustDBConf) Backend() Backend

func (*TrustDBConf) ConfigName

func (cfg *TrustDBConf) ConfigName() string

func (*TrustDBConf) Connection

func (cfg *TrustDBConf) Connection() string

func (*TrustDBConf) InitDefaults

func (cfg *TrustDBConf) InitDefaults()

InitDefaults choses the sqlite backend if no backend is set.

func (*TrustDBConf) MaxIdleConns

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

func (*TrustDBConf) MaxOpenConns

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

func (*TrustDBConf) New

func (cfg *TrustDBConf) New() (trust.DB, error)

New creates a trust database from the config.

func (*TrustDBConf) Sample

func (cfg *TrustDBConf) Sample(dst io.Writer, path config.Path, ctx config.CtxMap)

func (*TrustDBConf) Validate

func (cfg *TrustDBConf) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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