Documentation ¶
Index ¶
- Constants
- Variables
- func BadgerBlockstoreOptions(domain BlockstoreDomain, path string, readonly bool) (badgerbs.Options, error)
- type BlockstoreDomain
- type FsRepo
- func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error)
- func (fsr *FsRepo) APIToken() ([]byte, error)
- func (fsr *FsRepo) Exists() (bool, error)
- func (fsr *FsRepo) Init(t RepoType) error
- func (fsr *FsRepo) Lock(repoType RepoType) (LockedRepo, error)
- func (fsr *FsRepo) LockRO(repoType RepoType) (LockedRepo, error)
- func (fsr *FsRepo) SetConfigPath(cfgPath string)
- type LockedRepo
- type MemRepo
- type MemRepoOptions
- type Repo
- type RepoType
Constants ¶
View Source
const ( // UniversalBlockstore represents the blockstore domain for all data. // Right now, this includes chain objects (tipsets, blocks, messages), as // well as state. In the future, they may get segregated into different // domains. UniversalBlockstore = BlockstoreDomain("universal") HotBlockstore = BlockstoreDomain("hot") )
Variables ¶
View Source
var ( ErrNoAPIEndpoint = errors.New("API not running (no endpoint)") ErrNoAPIToken = errors.New("API token not set") ErrRepoAlreadyLocked = errors.New("repo is already locked (lotus daemon already running)") ErrClosedRepo = errors.New("repo is no longer open") // ErrInvalidBlockstoreDomain is returned by LockedRepo#Blockstore() when // an unrecognized domain is requested. ErrInvalidBlockstoreDomain = errors.New("invalid blockstore domain") )
View Source
var ErrRepoExists = xerrors.New("repo exists")
Functions ¶
func BadgerBlockstoreOptions ¶ added in v1.1.3
func BadgerBlockstoreOptions(domain BlockstoreDomain, path string, readonly bool) (badgerbs.Options, error)
BadgerBlockstoreOptions returns the badger options to apply for the provided domain.
Types ¶
type BlockstoreDomain ¶ added in v1.1.3
type BlockstoreDomain string
BlockstoreDomain represents the domain of a blockstore.
type FsRepo ¶
type FsRepo struct {
// contains filtered or unexported fields
}
FsRepo is struct for repo, use NewFS to create
func (*FsRepo) APIEndpoint ¶
APIEndpoint returns endpoint of API in this repo
func (*FsRepo) Lock ¶
func (fsr *FsRepo) Lock(repoType RepoType) (LockedRepo, error)
Lock acquires exclusive lock on this repo
func (*FsRepo) LockRO ¶ added in v0.9.0
func (fsr *FsRepo) LockRO(repoType RepoType) (LockedRepo, error)
Like Lock, except datastores will work in read-only mode
func (*FsRepo) SetConfigPath ¶ added in v0.8.1
type LockedRepo ¶
type LockedRepo interface { // Close closes repo and removes lock. Close() error // Returns datastore defined in this repo. // The supplied context must only be used to initialize the datastore. // The implementation should not retain the context for usage throughout // the lifecycle. Datastore(ctx context.Context, namespace string) (datastore.Batching, error) // Blockstore returns an IPLD blockstore for the requested domain. // The supplied context must only be used to initialize the blockstore. // The implementation should not retain the context for usage throughout // the lifecycle. Blockstore(ctx context.Context, domain BlockstoreDomain) (blockstore.Blockstore, error) // SplitstorePath returns the path for the SplitStore SplitstorePath() (string, error) // Returns config in this repo Config() (interface{}, error) SetConfig(func(interface{})) error GetStorage() (stores.StorageConfig, error) SetStorage(func(*stores.StorageConfig)) error Stat(path string) (fsutil.FsStat, error) DiskUsage(path string) (int64, error) // SetAPIEndpoint sets the endpoint of the current API // so it can be read by API clients SetAPIEndpoint(multiaddr.Multiaddr) error // SetAPIToken sets JWT API Token for CLI SetAPIToken([]byte) error // KeyStore returns store of private keys for Filecoin transactions KeyStore() (types.KeyStore, error) // Path returns absolute path of the repo Path() string // Readonly returns true if the repo is readonly Readonly() bool }
type MemRepo ¶
type MemRepo struct {
// contains filtered or unexported fields
}
func NewMemory ¶
func NewMemory(opts *MemRepoOptions) *MemRepo
NewMemory creates new memory based repo with provided options. opts can be nil, it will be replaced with defaults. Any field in opts can be nil, they will be replaced by defaults.
func (*MemRepo) APIEndpoint ¶
type MemRepoOptions ¶
type MemRepoOptions struct { Ds datastore.Datastore ConfigF func(RepoType) interface{} KeyStore map[string]types.KeyInfo }
MemRepoOptions contains options for memory repo
type Repo ¶
type Repo interface { // APIEndpoint returns multiaddress for communication with Lotus API APIEndpoint() (multiaddr.Multiaddr, error) // APIToken returns JWT API Token for use in operations that require auth APIToken() ([]byte, error) // Lock locks the repo for exclusive use. Lock(RepoType) (LockedRepo, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.