filemgr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT, Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

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")
	ErrClosedRepo        = errors.New("repo is no longer open")
)

Functions

func RandJWTConfig

func RandJWTConfig() (*config.JWTConfig, error)

Random generation of JWT config

Types

type FsRepo

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

FsRepo is struct for repo, use NewFS to create

func (*FsRepo) APIEndpoint

func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error)

APIEndpoint returns endpoint of API in this repo

func (*FsRepo) APISecret

func (fsr *FsRepo) APISecret() (*common.APIAlg, error)

func (*FsRepo) APIStrategyToken

func (fsr *FsRepo) APIStrategyToken(password string) (string, error)

func (*FsRepo) APIToken

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

func (*FsRepo) Config

func (fsr *FsRepo) Config() *config.Config

type OverrideParams

type OverrideParams struct {
	API string
}

type Repo

type Repo interface {
	// APIEndpoint returns multiaddress for communication with venus wallet API
	APIEndpoint() (multiaddr.Multiaddr, error)

	// APIToken returns JWT API Token for use in operations that require auth
	APIToken() ([]byte, error)

	APISecret() (*common.APIAlg, error)

	// APIStrategyToken cli pwd convert root token
	APIStrategyToken(password string) (string, error)

	Config() *config.Config
}

file system

func NewFS

func NewFS(path string, op *OverrideParams) (Repo, error)

NewFS creates a repo instance based on a path on file system

Jump to

Keyboard shortcuts

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