Documentation ¶
Index ¶
- Constants
- func Do(client *http.Client, req *http.Request, respBody any) error
- func Errorf(t *testing.T, got, want any)
- func NewMockServer(t *testing.T, apiSpecificPath string, statusCode int, testdataFile string) *httptest.Server
- func NewMockServerToAssertQuery(t *testing.T, expectedQuery string) *httptest.Server
- func NewMockServerToAssertRequestBody(t *testing.T, expectedRequestBody string) *httptest.Server
- func NewRequest(ctx context.Context, httpMethod string, url *url.URL, input any) (*http.Request, error)
- type ErrorResponse
Constants ¶
View Source
const ( DefaultBaseURL string = "https://api.track.toggl.com/" BasicAuthPassword string = "api_token" // Defined in Toggl Track API )
View Source
const (
APIToken string = "api_token"
)
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
It's highly likely that the got and want are compared just before calling errorf, so for the caller, the natural order of the arguments is got, want.
func NewMockServer ¶
Types ¶
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
func (*ErrorResponse) IsTemporaryError ¶
func (e *ErrorResponse) IsTemporaryError() (bool, string)
func (*ErrorResponse) IsTimeoutError ¶
func (e *ErrorResponse) IsTimeoutError() bool
Click to show internal directories.
Click to hide internal directories.