Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpOptions ¶
type HttpResponse ¶
func (*HttpResponse) GetBody ¶
func (r *HttpResponse) GetBody() interface{}
func (*HttpResponse) GetHeader ¶
func (r *HttpResponse) GetHeader() http.Header
func (*HttpResponse) GetRawBody ¶
func (r *HttpResponse) GetRawBody() []byte
func (*HttpResponse) GetStatusCode ¶
func (r *HttpResponse) GetStatusCode() int
func (*HttpResponse) HasBody ¶
func (r *HttpResponse) HasBody() bool
type HttpService ¶
type HttpService struct {
// contains filtered or unexported fields
}
func (*HttpService) Get ¶
func (s *HttpService) Get(ctx context.Context, url string, options HttpOptions) (IHttpResponse, error)
Get performs a GET request to the given URL.
type IHttpResponse ¶
type IHttpService ¶
type IHttpService interface {
Get(ctx context.Context, url string, options HttpOptions) (IHttpResponse, error)
}
func NewHttpService ¶
func NewHttpService(config *config.Config, userAgent string) IHttpService
func NewMockHttpService ¶
func NewMockHttpService(t *testing.T) IHttpService
type MockHttpResponse ¶
func NewMockHttpResponse ¶
func NewMockHttpResponse(t *testing.T) *MockHttpResponse
func (*MockHttpResponse) GetBody ¶
func (m *MockHttpResponse) GetBody() interface{}
func (*MockHttpResponse) GetHeader ¶
func (m *MockHttpResponse) GetHeader() http.Header
func (*MockHttpResponse) GetRawBody ¶
func (m *MockHttpResponse) GetRawBody() []byte
func (*MockHttpResponse) GetStatusCode ¶
func (m *MockHttpResponse) GetStatusCode() int
func (*MockHttpResponse) HasBody ¶
func (m *MockHttpResponse) HasBody() bool
type MockHttpService ¶
func (*MockHttpService) Get ¶
func (m *MockHttpService) Get(ctx context.Context, url string, options HttpOptions) (IHttpResponse, error)
Click to show internal directories.
Click to hide internal directories.