lbryinc

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Success bool          `json:"success"`
	Error   *string       `json:"error"`
	Data    *ResponseData `json:"data"`
}

APIResponse reflects internal-apis JSON response format.

type Client

type Client struct {
	ServerAddress string
	AuthToken     string
	Logger        *log.Logger
}

Client stores data about internal-apis call it is about to make.

func NewClient

func NewClient(authToken string) Client

NewClient returns a client instance for internal-apis. It requires authToken to be provided for authentication.

func (Client) Call

func (c Client) Call(object, method string, params map[string]interface{}) (ResponseData, error)

Call calls a remote internal-apis server, returning a response, wrapped into standardized API Response struct.

func (Client) UserMe

func (c Client) UserMe() (ResponseData, error)

UserMe returns user details for the user associated with the current auth_token

type ResponseData

type ResponseData map[string]interface{}

ResponseData is a map containing parsed json response.

Jump to

Keyboard shortcuts

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