internal

package
v0.0.0-...-b58dc6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 Do

func Do(client *http.Client, req *http.Request, respBody any) error

func Errorf

func Errorf(t *testing.T, got, want any)

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

func NewMockServer(t *testing.T, apiSpecificPath string, statusCode int, testdataFile string) *httptest.Server

func NewMockServerToAssertQuery

func NewMockServerToAssertQuery(t *testing.T, expectedQuery string) *httptest.Server

func NewMockServerToAssertRequestBody

func NewMockServerToAssertRequestBody(t *testing.T, expectedRequestBody string) *httptest.Server

func NewRequest

func NewRequest(ctx context.Context, httpMethod string, url *url.URL, input any) (*http.Request, error)

Types

type ErrorResponse

type ErrorResponse struct {
	StatusCode int
	Message    string
	Header     http.Header
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL