memory

package
v2.2.4-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

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 (c *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 (c *MemDB) GetEndpointInfo() model.EndpointInfo

func (*MemDB) LoadNode

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

***********************

Path Sync Target

***********************

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)

***********************

Event Emitter

***********************

func (*MemDB) SetTestPathURI

func (c *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(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)

***********************

Path Sync Source

***********************

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

GetCachedBranches loads branch in memory

Jump to

Keyboard shortcuts

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