Documentation ¶
Index ¶
- Constants
- type Backend
- func (b *Backend) BeginTransaction(ctx context.Context, opts *sql.TxOptions) (trust.Transaction, error)
- func (e Backend) ChainExists(ctx context.Context, d decoded.Chain) (bool, error)
- func (b *Backend) Close() error
- func (e Backend) GetIssuingGrantKeyInfo(ctx context.Context, ia addr.IA, version scrypto.Version) (trust.KeyInfo, error)
- func (e Backend) GetRawChain(ctx context.Context, id trust.ChainID) ([]byte, error)
- func (e Backend) GetRawTRC(ctx context.Context, id trust.TRCID) ([]byte, error)
- func (e Backend) GetTRC(ctx context.Context, id trust.TRCID) (*trc.TRC, error)
- func (e Backend) GetTRCInfo(ctx context.Context, id trust.TRCID) (trust.TRCInfo, error)
- func (e Backend) InsertChain(ctx context.Context, d decoded.Chain) (bool, bool, error)
- func (e Backend) InsertTRC(ctx context.Context, d decoded.TRC) (bool, error)
- func (b *Backend) SetMaxIdleConns(maxIdleConns int)
- func (b *Backend) SetMaxOpenConns(maxOpenConns int)
- func (e Backend) TRCExists(ctx context.Context, d decoded.TRC) (bool, error)
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 = `` /* 749-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements the trust DB with an SQLite backend.
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) BeginTransaction ¶
func (b *Backend) BeginTransaction(ctx context.Context, opts *sql.TxOptions) (trust.Transaction, error)
BeginTransaction begins a transaction on the database.
func (Backend) ChainExists ¶
func (Backend) GetIssuingGrantKeyInfo ¶
func (Backend) GetRawChain ¶
func (Backend) GetTRCInfo ¶
func (Backend) InsertChain ¶
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.