@@ -13,6 +13,15 @@ import (
1313 log "github.com/sirupsen/logrus"
1414)
1515
16+ const (
17+ defaultServerAddress = "https://api.lbry.com"
18+ timeout = 5 * time .Second
19+ headerForwardedFor = "X-Forwarded-For"
20+
21+ userObjectPath = "user"
22+ userMeMethod = "me"
23+ )
24+
1625// Client stores data about internal-apis call it is about to make.
1726type Client struct {
1827 AuthToken string
@@ -39,13 +48,6 @@ type APIResponse struct {
3948// ResponseData is a map containing parsed json response.
4049type ResponseData map [string ]interface {}
4150
42- const (
43- defaultServerAddress = "https://api.lbry.com"
44- timeout = 5 * time .Second
45- userObjectPath = "user"
46- headerForwardedFor = "X-Forwarded-For"
47- )
48-
4951// NewClient returns a client instance for internal-apis. It requires authToken to be provided
5052// for authentication.
5153func NewClient (authToken string , opts * ClientOpts ) Client {
@@ -133,5 +135,5 @@ func (c Client) Call(object, method string, params map[string]interface{}) (Resp
133135
134136// UserMe returns user details for the user associated with the current auth_token
135137func (c Client ) UserMe () (ResponseData , error ) {
136- return c .Call (userObjectPath , "me" , map [string ]interface {}{})
138+ return c .Call (userObjectPath , userMeMethod , map [string ]interface {}{})
137139}
0 commit comments