sqlite

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

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 = `` /* 521-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB implements the trust DB with an SQLite backend.

func New

func New(path string) (DB, error)

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 NewFromDB

func NewFromDB(db *sql.DB) DB

NewFromDB returns a new backend from the given database.

func (DB) Chains

func (e DB) Chains(ctx context.Context,
	query trust.ChainQuery) ([][]*x509.Certificate, error)

func (DB) Close

func (db DB) Close() error

Close closes the database.

func (DB) InsertChain

func (e DB) InsertChain(ctx context.Context, chain []*x509.Certificate) (bool, error)

func (DB) InsertTRC

func (e DB) InsertTRC(ctx context.Context, trc cppki.SignedTRC) (bool, error)

func (DB) SetMaxIdleConns

func (db DB) SetMaxIdleConns(maxIdleConns int)

SetMaxIdleConns sets the maximum number of idle connections.

func (DB) SetMaxOpenConns

func (db DB) SetMaxOpenConns(maxOpenConns int)

SetMaxOpenConns sets the maximum number of open connections.

func (DB) SignedTRC

func (e DB) SignedTRC(ctx context.Context, id cppki.TRCID) (cppki.SignedTRC, error)

Jump to

Keyboard shortcuts

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