memory

package
v4.2.4-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Overview

Package memory provides an in-memory basic implementation of an Endpoint, with nodes stored in a map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBEvent

type DBEvent struct {
	Type   string
	Source string
	Target string
}

type MemDB

type MemDB struct {
	Nodes []*tree.Node
	// contains filtered or unexported fields
}

func NewMemDB

func NewMemDB() *MemDB

func (*MemDB) AddIgnore

func (db *MemDB) AddIgnore(s string)

AddIgnore register a filename to be ignored (for tests only)

func (*MemDB) CreateNode

func (db *MemDB) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)

func (*MemDB) DeleteNode

func (db *MemDB) DeleteNode(ctx context.Context, path string) (err error)

func (*MemDB) FindByHash

func (db *MemDB) FindByHash(hash string) (node *tree.Node)

func (*MemDB) FindByUuid

func (db *MemDB) FindByUuid(id string) (node *tree.Node)

func (*MemDB) FromJSON

func (db *MemDB) FromJSON(name string) error

func (*MemDB) GetEndpointInfo

func (db *MemDB) GetEndpointInfo() model.EndpointInfo

func (*MemDB) LoadNode

func (db *MemDB) LoadNode(ctx context.Context, path string, extendedStats ...bool) (node *tree.Node, err error)

func (*MemDB) MoveNode

func (db *MemDB) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)

func (*MemDB) RegisterEventChannel

func (db *MemDB) RegisterEventChannel(out chan DBEvent)

func (*MemDB) SetTestPathURI

func (db *MemDB) SetTestPathURI(s string)

func (*MemDB) Stats

func (db *MemDB) Stats() string

func (*MemDB) String

func (db *MemDB) String() string

func (*MemDB) ToJSON

func (db *MemDB) ToJSON(name string) error

func (*MemDB) Walk

func (db *MemDB) Walk(ctx context.Context, walknFc model.WalkNodesFunc, root string, recursive bool) (err error)

func (*MemDB) Watch

func (db *MemDB) Watch(recursivePath string) (*model.WatchObject, error)

type MemDBWithCacheTest

type MemDBWithCacheTest struct {
	MemDB
}

MemDBWithCacheTest provides a structure for testing CachedBranchProvider related functions

func NewMemDBWithCacheTest

func NewMemDBWithCacheTest() *MemDBWithCacheTest

NewMemDBWithCacheTest creates a new MemDB implementing CachedBranchProvider interface

func (*MemDBWithCacheTest) GetCachedBranches

func (m *MemDBWithCacheTest) GetCachedBranches(ctx context.Context, roots ...string) (model.PathSyncSource, error)

GetCachedBranches loads branch in memory

Jump to

Keyboard shortcuts

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