Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Get(url string, output interface{}, headers ...HeaderValue) ([]byte, error) Post(url string, body []byte, output interface{}, headers ...HeaderValue) ([]byte, error) }
Client represents an HTTP client which can be used for issuing requests concurrently.
type HeaderValue ¶
HeaderValue represents a header with a value attached.
func NewHeader ¶
func NewHeader(header, value string) HeaderValue
NewHeader builds an HTTP header with a value.
type MockClient ¶
MockClient is a mock implementation of Client
func NewMockClient ¶
func NewMockClient() *MockClient
NewMockClient returns a mock implementation of Client
func (*MockClient) Get ¶
func (mock *MockClient) Get(url string, output interface{}, headers ...HeaderValue) ([]byte, error)
Get issues an HTTP Get on a specified URL and decodes the payload as JSON.
func (*MockClient) Post ¶
func (mock *MockClient) Post(url string, body []byte, output interface{}, headers ...HeaderValue) ([]byte, error)
Post is a utility function which marshals and issues an HTTP post on a specified URL.
Click to show internal directories.
Click to hide internal directories.