Documentation ¶
Index ¶
- type AcceptContentType
- type Client
- func (dc *Client) AddHeader(header string, value string) *Client
- func (dc *Client) Download(url string, out io.Writer, ...) error
- func (dc *Client) Get(url string) (*http.Response, error)
- func (dc *Client) GetBinaryFile(url string) (*http.Response, error)
- func (dc *Client) GetClient() *http.Client
- func (dc *Client) GetJSON(url string) (*http.Response, error)
- func (dc *Client) GetText(url string) (*http.Response, error)
- func (dc *Client) GetTokenType() string
- func (dc *Client) SetAccept(accept AcceptContentType) *Client
- func (dc *Client) SetDisableSSL(disableSSL bool) *Client
- func (dc *Client) SetHeaders(headers []string) *Client
- func (dc *Client) SetToken(token string) *Client
- func (dc *Client) SetTokenType(tokenType string) *Client
- type ClientContract
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptContentType ¶
type AcceptContentType string
const ( AcceptBinary AcceptContentType = "application/octet-stream" AcceptGitHubJSON AcceptContentType = "application/vnd.github+json" AcceptText AcceptContentType = "text/plain" )
type Client ¶
type Client struct { Headers []string Token string Accept string DisableSSL bool CreateClient func() *http.Client // contains filtered or unexported fields }
func (*Client) GetTokenType ¶
func (*Client) SetAccept ¶
func (dc *Client) SetAccept(accept AcceptContentType) *Client
func (*Client) SetDisableSSL ¶
func (*Client) SetHeaders ¶
func (*Client) SetTokenType ¶
type ClientContract ¶
type ClientContract interface { GetClient() *http.Client Get(url string) (*http.Response, error) GetJSON(url string) (*http.Response, error) GetBinaryFile(url string) (*http.Response, error) GetText(url string) (*http.Response, error) Download(url string, out io.Writer, progressBarCallback func(size int64) *pb.ProgressBar) error }
Click to show internal directories.
Click to hide internal directories.