hiddenpathdb

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HiddenPathDB

type HiddenPathDB interface {
	ReadWrite
	BeginTransaction(ctx context.Context, opts *sql.TxOptions) (Transaction, error)
	io.Closer
}

HiddenPathDB defines the interface that all HiddenPathDB backends have to implement

type Params

type Params struct {
	GroupIds hiddenpath.GroupIdSet
	EndsAt   addr.IA
}

Params contains the parameters with which the database can be queried.

type Read

type Read interface {
	// Get returns all path segment(s) matching the parameters specified.
	Get(context.Context, *Params) (query.Results, error)
}

Read defines all read operations of the hidden path DB.

type ReadWrite

type ReadWrite interface {
	Read
	Write
}

ReadWrite defines all read an write operations of the hidden path DB.

type Transaction

type Transaction interface {
	ReadWrite
	Commit() error
	Rollback() error
}

type Write

type Write interface {
	// Insert inserts or updates a hidden path segment. It returns the number of path segments
	// that have been inserted/updated.
	Insert(context.Context, *seg.Meta, hiddenpath.GroupIdSet) (pathdb.InsertStats, error)
	// Delete deletes all path segments that match the given query,
	// returning the number of deleted segments
	Delete(context.Context, *Params) (int, error)
	// DeleteExpired deletes all hidden path segments that are expired, using now as a reference.
	// Returns the number of deleted segments.
	DeleteExpired(context.Context, time.Time) (int, error)
}

Write defines all write operations of the hidden path DB.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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