fstree

package
v1.6.23 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package fstree provides a dead simple file-based database storage backend. It is primarily meant for easy testing or storing big files that can easily be accesses directly, without datastore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFSTree

func NewFSTree(name, location string) (storage.Interface, error)

NewFSTree returns a (new) FSTree database.

Types

type FSTree

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

FSTree database storage.

func (*FSTree) Delete

func (fst *FSTree) Delete(key string) error

Delete deletes a record from the database.

func (*FSTree) Get

func (fst *FSTree) Get(key string) (record.Record, error)

Get returns a database record.

func (*FSTree) GetMeta

func (fst *FSTree) GetMeta(key string) (*record.Meta, error)

GetMeta returns the metadata of a database record.

func (*FSTree) Injected

func (fst *FSTree) Injected() bool

Injected returns whether the database is injected.

func (*FSTree) MaintainRecordStates

func (fst *FSTree) MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time, shadowDelete bool) error

MaintainRecordStates maintains records states in the database.

func (*FSTree) Put

func (fst *FSTree) Put(r record.Record) (record.Record, error)

Put stores a record in the database.

func (*FSTree) Query

func (fst *FSTree) Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)

Query returns a an iterator for the supplied query.

func (*FSTree) ReadOnly

func (fst *FSTree) ReadOnly() bool

ReadOnly returns whether the database is read only.

func (*FSTree) Shutdown

func (fst *FSTree) Shutdown() error

Shutdown shuts down the database.

Jump to

Keyboard shortcuts

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