Documentation ¶
Overview ¶
Package storage provides factories for various application storage backends.
Index ¶
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, } 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()
type PathDB ¶ added in v0.7.0
func NewPathStorage ¶
Directories ¶
Path | Synopsis |
---|---|
Package beacon defines interfaces that extend the capabilities of a beacon storage compared to the beacon.DB interface.
|
Package beacon defines interfaces that extend the capabilities of a beacon storage compared to the beacon.DB interface. |
Package mock_storage is a generated GoMock package.
|
Package mock_storage is a generated GoMock package. |
Package trust defines interfaces that extend the capabilities of a trust storage compared to the trust.DB interface.
|
Package trust defines interfaces that extend the capabilities of a trust storage compared to the trust.DB interface. |
Click to show internal directories.
Click to hide internal directories.