pathdb

package
v0.0.0-...-3cef9f2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 16 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(backend backends.Backend, blobStore *blobs.Store) *DB

func Open

func Open(ctx context.Context, backend backends.Backend, blobStore *blobs.Store, stream io.Reader) (*DB, error)

func (*DB) Changed

func (db *DB) Changed() bool

func (*DB) Close

func (db *DB) Close() error

func (*DB) Delete

func (db *DB) Delete(ctx context.Context, path string) (removed bool, err error)

func (*DB) DeleteAll

func (db *DB) DeleteAll(ctx context.Context, matcher func(path string) (delete bool)) (removed int, err error)

func (*DB) Get

func (db *DB) Get(ctx context.Context, path string) (*manifest.Content, error)

func (*DB) HasPrefix

func (db *DB) HasPrefix(ctx context.Context, prefix string) (exists bool, err error)

func (*DB) List

func (db *DB) List(ctx context.Context, prefix string, recursive bool,
	cb func(ctx context.Context, path string, content *manifest.Content) error) error

func (*DB) Put

func (db *DB) Put(ctx context.Context, path string, content *manifest.Content) (state PutState, err error)

func (*DB) Rename

func (db *DB) Rename(ctx context.Context, re *regexp.Regexp, replacement string) (renamed int, err error)

Rename renames paths using regexp.ReplaceAllString (replacement can have regexp expansions). See the docs for regexp.ReplaceAllString

func (*DB) SerializeTo

func (db *DB) SerializeTo(ctx context.Context, destinationPath string) error

type PutState

type PutState int
const (
	PutStateNew       PutState = 1
	PutStateChanged   PutState = 2
	PutStateUnchanged PutState = 3
)

Directories

Path Synopsis
b
Package b implements the B+tree flavor of a BTree.
Package b implements the B+tree flavor of a BTree.

Jump to

Keyboard shortcuts

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