Documentation ¶
Index ¶
- func RWLockToggle(mu *sync.RWMutex) (func(), func())
- type Client
- func (c *Client) DoRequest(method, endpoint string, body io.Reader) (*http.Response, error)
- func (c *Client) Get(endpoint string) (*http.Response, error)
- func (c *Client) GetInto(endpoint string, target interface{}) error
- func (c *Client) Logger() log.FieldLogger
- func (c *Client) NewRequest(method, endpoint string, body io.Reader) (*http.Request, error)
- func (c *Client) Post(endpoint string, body interface{}) (*http.Response, error)
- func (c *Client) PostInto(endpoint string, body, target interface{}) error
- func (c *Client) Put(endpoint string, body interface{}) error
- type Doer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RWLockToggle ¶
RWLockToggle locks the given mutex for reading and returns two functions the first function returned should be used to unlock the mutex the second function returned will unlock the read lock and instead lock the mutex for writing the unlock function will always call the correct unlock method
Types ¶
type Client ¶
Client provides methods for communication with the Riot API.
func (*Client) DoRequest ¶
DoRequest processes a http.Request and returns the response. Rate-Limiting and retrying is handled via the corresponding response headers.
func (*Client) GetInto ¶
GetInto processes a GET request and saves the response body into the given target.
func (*Client) Logger ¶
func (c *Client) Logger() log.FieldLogger
Logger returns a logger with client specific fields set.
func (*Client) NewRequest ¶
NewRequest returns a new http.Request with necessary headers et.