pathdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(path string, backend string) (*DB, error)

New creates a new or open an existing PathDB at a given path using the given backend.

func (*DB) Delete

func (db *DB) Delete(ctx context.Context, segID common.RawBytes) (int, error)

Delete deletes a path segment with a given ID. Returns the number of deleted path segments (0 or 1).

func (*DB) DeleteWithIntf

func (db *DB) DeleteWithIntf(ctx context.Context, intf query.IntfSpec) (int, error)

DeleteWithIntf deletes all path segments that contain a given interface. Returns the number of path segments deleted.

func (*DB) Get

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

Get returns all path segment(s) matching the parameters specified.

func (*DB) Insert

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

Insert inserts or updates a path segment. It returns the number of path segments that have been inserted/updated.

func (*DB) InsertWithHPCfgIDs

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

InsertWithHPCfgIDs inserts or updates a path segment with a set of HPCfgIDs. It returns the number of path segments that have been inserted/updated.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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