repo

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagWalletRepo = "wallet-repo"
)

Variables

View Source
var (
	ErrNoAPIEndpoint     = errors.New("API not running (no endpoint)")
	ErrRepoAlreadyLocked = errors.New("repo is already locked (openfild already running)")
	ErrClosedRepo        = errors.New("repo is no longer open")
)

Functions

This section is empty.

Types

type FsRepo

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

func NewFS

func NewFS(path string) (*FsRepo, error)

func (*FsRepo) APIEndpoint

func (fsr *FsRepo) APIEndpoint() (string, error)

func (*FsRepo) APIToken

func (fsr *FsRepo) APIToken() ([]byte, error)

func (*FsRepo) Exists

func (fsr *FsRepo) Exists() (bool, error)

func (*FsRepo) Init

func (fsr *FsRepo) Init() error

func (*FsRepo) Lock

func (fsr *FsRepo) Lock() (LockedRepo, error)

func (*FsRepo) LockRO

func (fsr *FsRepo) LockRO() (LockedRepo, error)

type LockedRepo

type LockedRepo interface {
	// Close closes repo and removes lock.
	Close() error

	// CloseRO closes repo
	CloseRO() error

	// Datastore 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) (datastore.Batching, error)

	// Path returns absolute path of the repo
	Path() string

	// Readonly returns true if the repo is readonly
	Readonly() bool

	// SetAPIEndpoint sets the endpoint of the current API
	SetAPIEndpoint(string) error

	SetAPIToken([]byte) error
}

type Repo

type Repo interface {
	// APIEndpoint returns multiaddress for communication with Lotus API
	APIEndpoint() (string, error)

	// Lock locks the repo for exclusive use.
	Lock() (LockedRepo, error)
}

Jump to

Keyboard shortcuts

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