repo

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LockFile   = "repo.lock"
	ConfigFile = "config"
	SpecsFile  = "datastore_spec"

	SupportedRepoVersion = 11
	ToolVersion          = "0.6.0"
)

Variables

This section is empty.

Functions

func DatastoreSpec

func DatastoreSpec(params map[string]interface{}) (string, error)

Types

type ConfigFromMap

type ConfigFromMap func(map[string]interface{}) (DatastoreConfig, error)

From https://github.com/ipfs/go-ipfs/blob/8525be5990d3a0b5ece0d6773764756f9cbf15e9/repo/fsrepo/datastores.go ConfigFromMap creates a new datastore config from a map

type Datastore

type Datastore interface {
	ds.Batching
}

func OpenDatastore

func OpenDatastore(path string, params map[string]interface{}) (Datastore, error)

type DatastoreConfig

type DatastoreConfig interface {
	// DiskSpec returns a minimal configuration of the datastore
	// represting what is stored on disk.  Run time values are
	// excluded.
	DiskSpec() DiskSpec

	// Create instantiate a new datastore from this config
	Create(path string) (Datastore, error)
}

DatastoreConfig is an abstraction of a datastore config. A "spec" is first converted to a DatastoreConfig and then Create() is called to instantiate a new datastore

func AnyDatastoreConfig

func AnyDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

AnyDatastoreConfig returns a DatastoreConfig from a spec based on the "type" parameter

func BadgerdsDatastoreConfig

func BadgerdsDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

BadgerdsDatastoreConfig returns a configuration stub for a badger datastore from the given parameters

func FlatfsDatastoreConfig

func FlatfsDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

FlatfsDatastoreConfig returns a flatfs DatastoreConfig from a spec

func LeveldsDatastoreConfig

func LeveldsDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

LeveldsDatastoreConfig returns a levelds DatastoreConfig from a spec

func LogDatastoreConfig

func LogDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

LogDatastoreConfig returns a log DatastoreConfig from a spec

func MeasureDatastoreConfig

func MeasureDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

MeasureDatastoreConfig returns a measure DatastoreConfig from a spec

func MemDatastoreConfig

func MemDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

MemDatastoreConfig returns a memory DatastoreConfig from a spec

func MountDatastoreConfig

func MountDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

MountDatastoreConfig returns a mount DatastoreConfig from a spec

type DiskSpec

type DiskSpec map[string]interface{}

DiskSpec is the type returned by the DatastoreConfig's DiskSpec method

func (DiskSpec) Bytes

func (spec DiskSpec) Bytes() []byte

Bytes returns a minimal JSON encoding of the DiskSpec

func (DiskSpec) String

func (spec DiskSpec) String() string

String returns a minimal JSON encoding of the DiskSpec

type Retry

type Retry struct {
	*retry.Datastore
	io.Closer
}

func (*Retry) Close

func (ds *Retry) Close() error

Jump to

Keyboard shortcuts

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