Documentation
¶
Overview ¶
Package storage provides factories for various application storage backends.
Index ¶
- Constants
- Variables
- func NewBeaconStorage(c DBConfig, ia addr.IA) (beacon.DB, error)
- func NewPathStorage(c DBConfig) (pathdb.PathDB, error)
- func NewRenewalStorage(c DBConfig) (renewal.DB, error)
- func NewRevocationStorage() revcache.RevCache
- func NewTrustStorage(c DBConfig) (trust.DB, error)
- func SetConnLimits(d db.LimitSetter, c DBConfig)
- type Backend
- type DBConfig
Constants ¶
View Source
const ( // BackendSqlite indicates an sqlite backend. BackendSqlite Backend = "sqlite" // DefaultPath indicates the default connection string for a generic database. DefaultPath = "/share/scion.db" DefaultTrustDBPath = "/share/data/%s.trust.db" DefaultPathDBPath = "/share/cache/%s.path.db" )
Variables ¶
View Source
var ( SampleBeaconDB = DBConfig{ Connection: "/share/cache/%s.beacon.db", } SamplePathDB = DBConfig{ Connection: DefaultPathDBPath, } SampleRenewalDB = DBConfig{ Connection: "/share/data/trustdb/%s.renewal.db", } SampleTrustDB = DBConfig{ Connection: DefaultTrustDBPath, } )
Default samples for various databases.
Functions ¶
func NewRevocationStorage ¶
func SetConnLimits ¶
func SetConnLimits(d db.LimitSetter, c DBConfig)
SetConnLimits sets the maximum number of open and idle connections based on the configuration. Limits of 0 mean the Go default will be used.
Types ¶
type DBConfig ¶
type DBConfig struct {
Connection string `toml:"connection,omitempty"`
MaxOpenConns int `toml:"max_open_conns,omitempty"`
MaxIdleConns int `toml:"max_idle_conns,omitempty"`
}
DBConfig is the configuration for the connection to a database.
func SetID ¶
SetID returns a clone of the configuration that has the ID set on the connection string.
func (*DBConfig) ConfigName ¶
ConfigName is the key in the toml file.
func (*DBConfig) InitDefaults ¶
func (cfg *DBConfig) InitDefaults()
Click to show internal directories.
Click to hide internal directories.