endpoint

package
v0.9.2-dev.20191219 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: GPL-3.0 Imports: 25 Imported by: 2

Documentation

Overview

Package endpoint provides some specific factories to provide Endpoints to the sync library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDirForURI added in v0.8.0

func DefaultDirForURI(uri string) string

DefaultDirForURI tries to find a default directory to display to user when they choose a specific endpoint. Currently only used for FS, returning ${HOMEDIR}/Cells

func EndpointFromURI

func EndpointFromURI(uri string, otherUri string, browseOnly ...bool) (ep model.Endpoint, e error)

EndpointFromURI parse an URI string to instantiate a proper Endpoint

func NewSnapshotFactory

func NewSnapshotFactory(configPath string, left model.Endpoint, right model.Endpoint) model.SnapshotFactory

NewSnapshotFactory opens a new SnapshotFactory.

Types

type PatchStore

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

PatchStore is a persistence layer for storing patches. It is based on BoltDB

func NewPatchStore

func NewPatchStore(folderPath string, source model.Endpoint, target model.Endpoint) (*PatchStore, error)

NewPatchStore opens a new PatchStore

func (*PatchStore) Load

func (p *PatchStore) Load(offset, limit int) (patches []merger.Patch, e error)

Load list all patches

func (*PatchStore) PublishPatch

func (p *PatchStore) PublishPatch(patch merger.Patch)

PublishPatch pushes patch to the persist queue

func (*PatchStore) Stop

func (p *PatchStore) Stop()

Stop closes the DB.

func (*PatchStore) Store

func (p *PatchStore) Store(patch merger.Patch)

Store pushes the patch to the DB.

type SnapshotFactory

type SnapshotFactory struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SnapshotFactory implements model.SnapshotProvider interface for persisting snapshots in a BoltDB.

func (*SnapshotFactory) Close added in v0.8.0

func (f *SnapshotFactory) Close(ctx context.Context) error

Close closes the BoltDB.

func (*SnapshotFactory) Load

Load creates or loads an existing snapshot from within the application dir

func (*SnapshotFactory) Reset

func (f *SnapshotFactory) Reset(ctx context.Context) error

Reset clears all snapshots (left and right)

Jump to

Keyboard shortcuts

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