Documentation
¶
Index ¶
- Variables
- func Version180Upgrade(fsr *fsLockedRepo) error
- type FsRepo
- func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error)
- func (fsr *FsRepo) APIToken() ([]byte, error)
- func (fsr *FsRepo) Config() (interface{}, error)
- func (fsr *FsRepo) Exists() (bool, error)
- func (fsr *FsRepo) Init() error
- func (fsr *FsRepo) Lock() (LockedRepo, error)
- func (fsr *FsRepo) SetConfigPath(cfgPath string)
- func (fsr *FsRepo) Update(cfg *config.MinerConfig) error
- type LockedRepo
- type Repo
- type UpgradeFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAPIEndpoint = errors.New("API not running (no endpoint)") ErrRepoAlreadyLocked = errors.New("repo is already locked") ErrClosedRepo = errors.New("repo is no longer open") )
View Source
var ErrRepoExists = errors.New("repo exists")
Functions ¶
func Version180Upgrade ¶
func Version180Upgrade(fsr *fsLockedRepo) error
Types ¶
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() (LockedRepo, error)
Lock acquires exclusive lock on this repo
func (*FsRepo) SetConfigPath ¶
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)
// Returns config in this repo
Config() (interface{}, error)
SetConfig(func(interface{})) 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
// Path returns absolute path of the repo
Path() string
// SetVersion sets the version number
SetVersion(version string) error
// Migrate used to upgrade the repo
Migrate() error
}
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() (LockedRepo, error)
}
type UpgradeFunc ¶
type UpgradeFunc func(*fsLockedRepo) error
Click to show internal directories.
Click to hide internal directories.