Documentation ¶
Index ¶
- Constants
- func Create(serverAddress string, userID int) error
- func DisableLogger()
- func GetDBUserG(id int) (*models.User, error)
- func GetUserWithSDKServer(rt *sdkrouter.Router, internalAPIHost, token, metaRemoteIP string) (*models.User, error)
- func LoadWallet(addr string, userID int) error
- func UnloadWallet(addr string, userID int) error
Constants ¶
const (
TokenHeader = "X-Lbry-Auth-Token"
)
TokenHeader is the name of HTTP header which is supplied by client and should contain internal-api auth_token.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a wallet on an sdk 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), loadWallet() should be called instead.
func DisableLogger ¶
func DisableLogger()
func GetDBUserG ¶ added in v0.14.3
GetDBUserG returns a database user with LbrynetServer selected, using the global executor.
func GetUserWithSDKServer ¶ added in v0.13.5
func GetUserWithSDKServer(rt *sdkrouter.Router, internalAPIHost, token, metaRemoteIP string) (*models.User, error)
GetUserWithWallet gets user by internal-apis auth token. If the user does not have a wallet yet, they are assigned an SDK and a wallet is created for them on that SDK.
func LoadWallet ¶ added in v0.13.7
loadWallet 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 UnloadWallet ¶
UnloadWallet unloads an existing wallet from the LbrynetServer. May return errors:
WalletAlreadyLoaded - wallet is already loaded and operational WalletNotFound - wallet file does not exist and won't be loaded.
Types ¶
This section is empty.