sqlite

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 14 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 = 4
	// Schema is the SQLite database layout.
	Schema = `` /* 1372-byte string literal not displayed */

	SegmentsTable  = "Segments"
	IntfToSegTable = "IntfToSeg"
	StartsAtTable  = "StartsAt"
	EndsAtTable    = "EndsAt"
	SegTypesTable  = "SegTypes"
	HpCfgIdsTable  = "HpCfgIds"
	NextQueryTable = "NextQuery"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(path string) (*Backend, 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 (*Backend) Delete

func (b *Backend) Delete(ctx context.Context, params *query.Params) (int, error)

func (*Backend) DeleteExpired added in v0.3.0

func (b *Backend) DeleteExpired(ctx context.Context, now time.Time) (int, error)

func (*Backend) Get

func (b *Backend) Get(ctx context.Context, params *query.Params) ([]*query.Result, error)

func (*Backend) GetNextQuery added in v0.3.0

func (b *Backend) GetNextQuery(ctx context.Context, dst addr.IA) (*time.Time, error)

func (*Backend) Insert

func (b *Backend) Insert(ctx context.Context, pseg *seg.PathSegment,
	segTypes []proto.PathSegType) (int, error)

func (*Backend) InsertNextQuery added in v0.3.0

func (b *Backend) InsertNextQuery(ctx context.Context, dst addr.IA,
	nextQuery time.Time) (bool, error)

func (*Backend) InsertWithHPCfgIDs

func (b *Backend) InsertWithHPCfgIDs(ctx context.Context, pseg *seg.PathSegment,
	segTypes []proto.PathSegType, hpCfgIDs []*query.HPCfgID) (int, error)

Jump to

Keyboard shortcuts

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