lbrynet

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleStreamCreateRequest = `` /* 482-byte string literal not displayed */
View Source
var ExampleStreamCreateResponse = `` /* 4723-byte string literal not displayed */
View Source
var Logger = monitor.NewModuleLogger("lbrynet")

Functions

func AddWallet added in v0.9.0

func AddWallet(uid int) (*ljsonrpc.Wallet, error)

AddWallet loads an existing wallet in the LbrynetServer. May return errors:

WalletAlreadyLoaded - wallet is already loaded and operational
WalletNotFound - wallet file does not exist and won't be loaded.

func CreateWallet added in v0.9.0

func CreateWallet(uid int) (*ljsonrpc.Wallet, models.LbrynetServer, error)

CreateWallet creates a new wallet with the LbrynetServer. Returned error doesn't necessarily mean that the wallet is not operational:

	if errors.Is(err, lbrynet.WalletExists) {
	 // Okay to proceed with the account
 }

	if errors.Is(err, lbrynet.WalletNeedsLoading) {
	 // AddWallet() needs to be called before the wallet can be used
 }

func InitializeWallet added in v0.9.0

func InitializeWallet(uid int) (models.LbrynetServer, string, error)

InitializeWallet creates a wallet that can be immediately used in subsequent commands. It can recover from errors like existing wallets, but if a wallet is known to exist (eg. a wallet ID stored in the database already), AddWallet should be called instead.

func NewWalletError added in v0.9.0

func NewWalletError(uid int, err error) error

NewWalletError converts plain SDK error to the typed one

func Resolve

func Resolve(url string) (*ljsonrpc.Claim, error)

Resolve calls resolve method on the daemon and handles *frequent* LbrynetServer response format changes with grace instead of panicking.

func WalletRemove added in v0.9.0

func WalletRemove(uid int) (*ljsonrpc.Wallet, error)

WalletRemove loads an existing wallet in the LbrynetServer. May return errors:

WalletAlreadyLoaded - wallet is already loaded and operational
WalletNotFound - wallet file does not exist and won't be loaded.

Types

type AccountConflict

type AccountConflict struct {
	UID int
	Err error
}

func (AccountConflict) Error

func (e AccountConflict) Error() string

type AccountNotFound

type AccountNotFound struct {
	UID int
	Err error
}

func (AccountNotFound) Error

func (e AccountNotFound) Error() string

type WalletAlreadyLoaded added in v0.9.0

type WalletAlreadyLoaded struct {
	WalletError
}

func (WalletAlreadyLoaded) Error added in v0.9.0

func (e WalletAlreadyLoaded) Error() string

type WalletError added in v0.9.0

type WalletError struct {
	UID int
	Err error
	// contains filtered or unexported fields
}

func (WalletError) Error added in v0.9.0

func (e WalletError) Error() string

func (WalletError) Unwrap added in v0.9.0

func (e WalletError) Unwrap() error

type WalletExists added in v0.9.0

type WalletExists struct {
	WalletError
}

func (WalletExists) Error added in v0.9.0

func (e WalletExists) Error() string

type WalletNeedsLoading added in v0.9.0

type WalletNeedsLoading struct {
	WalletError
}

func (WalletNeedsLoading) Error added in v0.9.0

func (e WalletNeedsLoading) Error() string

type WalletNotFound added in v0.9.0

type WalletNotFound struct {
	WalletError
}

type WalletNotLoaded added in v0.9.0

type WalletNotLoaded struct {
	WalletError
}

func (WalletNotLoaded) Error added in v0.9.0

func (e WalletNotLoaded) Error() string

Jump to

Keyboard shortcuts

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