Documentation ¶
Index ¶
- type RestClient
- func (r RestClient) Delete(url string) (*http.Response, error)
- func (r RestClient) DeleteJson(url string, body interface{}) (*http.Response, error)
- func (r RestClient) Get(url string) (*http.Response, error)
- func (r RestClient) Post(url string) (*http.Response, error)
- func (r RestClient) PostJson(url string, body interface{}) (*http.Response, error)
- func (r RestClient) PostMultipart(url string, parts map[string]io.Reader) (*http.Response, error)
- func (r RestClient) Put(url string) (*http.Response, error)
- func (r RestClient) PutJson(url string, body interface{}) (*http.Response, error)
- func (r RestClient) WithAuthentication(tokenSource oauth2.TokenSource) RestClient
- func (r RestClient) WithTimeout(timeout time.Duration) RestClient
- func (r RestClient) WithTransport(tr http.RoundTripper) RestClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RestClient ¶
func New ¶
func New() RestClient
func NewWithClient ¶
func NewWithClient(client *http.Client) RestClient
func (RestClient) DeleteJson ¶
func (r RestClient) DeleteJson(url string, body interface{}) (*http.Response, error)
func (RestClient) PostJson ¶
func (r RestClient) PostJson(url string, body interface{}) (*http.Response, error)
func (RestClient) PostMultipart ¶
PostMultipart performs multipart form post with provided parts. Pay attention that it does NOT close io.Reader's of parts! It is task of caller to close Readers
func (RestClient) PutJson ¶
func (r RestClient) PutJson(url string, body interface{}) (*http.Response, error)
func (RestClient) WithAuthentication ¶
func (r RestClient) WithAuthentication(tokenSource oauth2.TokenSource) RestClient
func (RestClient) WithTimeout ¶
func (r RestClient) WithTimeout(timeout time.Duration) RestClient
func (RestClient) WithTransport ¶
func (r RestClient) WithTransport(tr http.RoundTripper) RestClient
Click to show internal directories.
Click to hide internal directories.