Documentation ¶
Index ¶
- type PathDBAdapter
- func (a *PathDBAdapter) BeginTransaction(ctx context.Context, opts *sql.TxOptions) (hiddenpathdb.Transaction, error)
- func (a *PathDBAdapter) Close() error
- func (rw PathDBAdapter) Delete(ctx context.Context, params *hiddenpathdb.Params) (int, error)
- func (rw PathDBAdapter) DeleteExpired(ctx context.Context, now time.Time) (int, error)
- func (rw PathDBAdapter) Get(ctx context.Context, params *hiddenpathdb.Params) (query.Results, error)
- func (rw PathDBAdapter) Insert(ctx context.Context, seg *seg.Meta, ids hiddenpath.GroupIdSet) (pathdb.InsertStats, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathDBAdapter ¶
type PathDBAdapter struct {
// contains filtered or unexported fields
}
PathDBAdapter implements the HiddenPathDB interface. It wraps an implementation of PathDB.
func New ¶
func New(pdb pathdb.PathDB) *PathDBAdapter
New returns a new PathDBAdapter with an implementation of PathDB as backend.
func (*PathDBAdapter) BeginTransaction ¶
func (a *PathDBAdapter) BeginTransaction(ctx context.Context, opts *sql.TxOptions) ( hiddenpathdb.Transaction, error)
BeginTransaction begins a database read-write transacation
func (*PathDBAdapter) Close ¶
func (a *PathDBAdapter) Close() error
Close closes the backend database
func (PathDBAdapter) Delete ¶
Delete deletes all path segments that match the given query, returning the number of deleted segments
func (PathDBAdapter) DeleteExpired ¶
DeleteExpired deletes all hidden path segments that are expired, using now as a reference. Returns the number of deleted segments.
func (PathDBAdapter) Get ¶
func (rw PathDBAdapter) Get(ctx context.Context, params *hiddenpathdb.Params) (query.Results, error)
Get fetches all the hidden path segments matching the given parameters
func (PathDBAdapter) Insert ¶
func (rw PathDBAdapter) Insert(ctx context.Context, seg *seg.Meta, ids hiddenpath.GroupIdSet) (pathdb.InsertStats, error)
Insert inserts a hidden path segment into the the underlying PathDB