Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultBaseURI contains the base URI for the API. DefaultBaseURI string = "https://xbl.io/api/v2/" // RetryCount controls how many times the client will retry on failure. RetryCount int = 10 // RetryDelay controls the delay between retries. RetryDelay time.Duration = 2 * time.Second // UserAgent defines the user agent that is sent with the requests. UserAgent string = "go-openxbl" )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { sync.Mutex UserAgent string // Base URL for API requests. Defaults to the public OpenXBL API. BaseURL should // always be specified with a trailing slash. BaseURI *url.URL // Services used for talking to different parts of the OpenXBL API. FriendsService *FriendsService // contains filtered or unexported fields }
Client represents the config of the OpenXBL Client
func (*Client) Do ¶
Do sends an API request to the OpenXBL API and returns a response object. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURI of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
type FriendSeachResp ¶
type FriendSeachResp struct {
ProfileUsers []User `json:"profileUsers,omitempty"`
}
FriendSeachResp contains the response from the /friends/search operation.
type FriendsService ¶
type FriendsService apiService
FriendsService provides access to the Friends related functions in the OpenXBL API.
OpenXBL API docs: https://xbl.io/console