Documentation ¶
Overview ¶
Package parse provides a client for the Parse API.
Index ¶
- type Client
- func (c *Client) Delete(u *url.URL, result interface{}) (*http.Response, error)
- func (c *Client) Do(req *http.Request, body, result interface{}) (*http.Response, error)
- func (c *Client) Get(u *url.URL, result interface{}) (*http.Response, error)
- func (c *Client) Post(u *url.URL, body, result interface{}) (*http.Response, error)
- func (c *Client) Put(u *url.URL, body, result interface{}) (*http.Response, error)
- func (c *Client) RoundTrip(req *http.Request) (*http.Response, error)
- func (c *Client) WithCredentials(cr Credentials) *Client
- type Credentials
- type Error
- type MasterKey
- type RawError
- type RestAPIKey
- type SessionToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // The underlying http.RoundTripper to perform the individual requests. When // nil http.DefaultTransport will be used. Transport http.RoundTripper // The base URL to parse relative URLs off. If you pass absolute URLs to // Client functions they are used as-is. When nil, the production Parse URL // will be used. BaseURL *url.URL // Credentials if set, will be included on every request. Credentials Credentials // UserAgent to use in the User-Agent header. When nil defaultUserAgent // will be used. UserAgent string }
Client provides access to the Parse API.
func (*Client) Delete ¶
Delete performs a DELETE method call on the given url and unmarshal response into result.
func (*Client) Do ¶
Do performs a Parse API call. This method modifies the request and adds the Authentication headers. The body is JSON encoded and for responses in the 2xx or 3xx range the response will be JSON decoded into result, for others an error of type Error will be returned.
func (*Client) Get ¶
Get performs a GET method call on the given url and unmarshal response into result.
func (*Client) Post ¶
Post performs a POST method call on the given url with the given body and unmarshal response into result.
func (*Client) Put ¶
Put performs a PUT method call on the given url with the given body and unmarshal response into result.
func (*Client) RoundTrip ¶
RoundTrip performs a RoundTrip ignoring the request and response bodies. It is up to the caller to close them. This method modifies the request.
func (*Client) WithCredentials ¶
func (c *Client) WithCredentials(cr Credentials) *Client
WithCredentials returns a new instance of the Client using the given Credentials. It discards the previous Credentials.
type Credentials ¶
Credentials allows for adding authentication information to a request.
type Error ¶
An Error from the Parse API. When a valid Parse JSON error is found, the returned error will be of this type.
type RawError ¶
A RawError with the HTTP StatusCode and Body. When a valid Parse JSON error is not found, the returned error will be of this type.
type RestAPIKey ¶
RestAPIKey adds the Rest API Key to the request.