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 Transaction ¶
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.
Click to show internal directories.
Click to hide internal directories.