Documentation ¶
Index ¶
- func JsonArray(j interface{}) []interface{}
- func JsonObjectGet(j interface{}, key string) interface{}
- func JsonString(j interface{}) string
- type Error
- type HTTPClient
- func (c *HTTPClient) Get(ctx context.Context, url string, headers ...HTTPHeader) ([]byte, error)
- func (c *HTTPClient) GetJSONArray(ctx context.Context, url string, headers ...HTTPHeader) ([]interface{}, error)
- func (c *HTTPClient) GetJSONObject(ctx context.Context, url string, headers ...HTTPHeader) (map[string]interface{}, error)
- type HTTPHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonObjectGet ¶
func JsonObjectGet(j interface{}, key string) interface{}
func JsonString ¶
func JsonString(j interface{}) string
Types ¶
type Error ¶
func NewErrorFromResponse ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient() *HTTPClient
func (*HTTPClient) Get ¶
func (c *HTTPClient) Get(ctx context.Context, url string, headers ...HTTPHeader) ([]byte, error)
func (*HTTPClient) GetJSONArray ¶
func (c *HTTPClient) GetJSONArray(ctx context.Context, url string, headers ...HTTPHeader) ([]interface{}, error)
func (*HTTPClient) GetJSONObject ¶
func (c *HTTPClient) GetJSONObject(ctx context.Context, url string, headers ...HTTPHeader) (map[string]interface{}, error)
type HTTPHeader ¶
func NewHTTPHeader ¶
func NewHTTPHeader(name, value string) HTTPHeader
Click to show internal directories.
Click to hide internal directories.