Documentation ¶
Index ¶
- Constants
- type Backend
- func (e Backend) AllRevocations(ctx context.Context) (<-chan beacon.RevocationOrErr, error)
- func (e Backend) BeaconSources(ctx context.Context) ([]addr.IA, error)
- func (b *Backend) BeginTransaction(ctx context.Context, opts *sql.TxOptions) (beacon.Transaction, error)
- func (e Backend) CandidateBeacons(ctx context.Context, setSize int, usage beacon.Usage, src addr.IA) (<-chan beacon.BeaconOrErr, error)
- func (b *Backend) Close() error
- func (e Backend) DeleteExpiredBeacons(ctx context.Context, now time.Time) (int, error)
- func (e Backend) DeleteExpiredRevocations(ctx context.Context, now time.Time) (int, error)
- func (e Backend) DeleteRevocation(ctx context.Context, ia addr.IA, ifid common.IFIDType) error
- func (e Backend) DeleteRevokedBeacons(ctx context.Context, now time.Time) (int, error)
- func (e Backend) InsertBeacon(ctx context.Context, b beacon.Beacon, usage beacon.Usage) (beacon.InsertStats, error)
- func (e Backend) InsertRevocation(ctx context.Context, revocation *path_mgmt.SignedRevInfo) error
- func (b *Backend) SetMaxIdleConns(maxIdleConns int)
- func (b *Backend) SetMaxOpenConns(maxOpenConns int)
Constants ¶
View Source
const ( // SchemaVersion is the version of the SQLite schema understood by this backend. // Whenever changes to the schema are made, this version number should be increased // to prevent data corruption between incompatible database schemas. SchemaVersion = 1 // Schema is the SQLite database layout. Schema = `` /* 914-byte string literal not displayed */ BeaconsTable = "Beacons" IntfToBeaconTable = "IntfToBeacon" RevocationsTable = "Revocations" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func New ¶
New returns a new SQLite backend opening a database at the given path. If no database exists a new database is be created. If the schema version of the stored database is different from the one in schema.go, an error is returned.
func (Backend) AllRevocations ¶
func (e Backend) AllRevocations(ctx context.Context) (<-chan beacon.RevocationOrErr, error)
func (Backend) BeaconSources ¶
func (*Backend) BeginTransaction ¶
func (b *Backend) BeginTransaction(ctx context.Context, opts *sql.TxOptions) (beacon.Transaction, error)
BeginTransaction begins a transaction on the database.
func (Backend) CandidateBeacons ¶
func (Backend) DeleteExpiredBeacons ¶
func (Backend) DeleteExpiredRevocations ¶
func (Backend) DeleteRevocation ¶
func (Backend) DeleteRevokedBeacons ¶
func (Backend) InsertBeacon ¶
func (e Backend) InsertBeacon(ctx context.Context, b beacon.Beacon, usage beacon.Usage) (beacon.InsertStats, error)
InsertBeacon inserts the beacon if it is new or updates the changed information.
func (Backend) InsertRevocation ¶
func (e Backend) InsertRevocation(ctx context.Context, revocation *path_mgmt.SignedRevInfo) error
func (*Backend) SetMaxIdleConns ¶
SetMaxIdleConns sets the maximum number of idle connections.
func (*Backend) SetMaxOpenConns ¶
SetMaxOpenConns sets the maximum number of open connections.
Click to show internal directories.
Click to hide internal directories.