repo

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Root                       = ".datahop"
	LockFile                   = "repo.lock"
	DefaultDatastoreFolderName = "datastore"
	// DefaultConfigFile is the filename of the configuration file
	DefaultConfigFile = "config"
	DefaultStateFile  = "state"
)

Variables

View Source
var (
	ErrorRepoClosed = errors.New("cannot access config, repo not open")
)

Functions

func ConfigFilename

func ConfigFilename(configroot string) (string, error)

ConfigFilename returns the configuration file path given a configuration root directory. If the configuration root directory is empty, use the default one

func Init

func Init(repoPath, swarmPort string) error

Init initialises ipfs persistent repository to a given location

Types

type Datastore

type Datastore interface {
	ds.Batching // must be thread-safe
}

Datastore is the interface required from a datastore to be acceptable to FSRepo.

type FSRepo

type FSRepo struct {
	io.Closer
	// contains filtered or unexported fields
}

func (*FSRepo) Close

func (r *FSRepo) Close() error

func (*FSRepo) Config

func (r *FSRepo) Config() (*config.Config, error)

func (*FSRepo) Datastore

func (r *FSRepo) Datastore() Datastore

func (*FSRepo) Path

func (r *FSRepo) Path() string

func (*FSRepo) SetState

func (r *FSRepo) SetState() error

func (*FSRepo) State

func (r *FSRepo) State() *bloom.BloomFilter

type Repo

type Repo interface {
	Path() string
	Config() (*config.Config, error)
	Datastore() Datastore
	Close() error
	State() *bloom.BloomFilter
	SetState() error
}

func Open

func Open(repoPath string) (Repo, error)

Open the FSRepo at path. Returns an error if the repo is not initialized.

Jump to

Keyboard shortcuts

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