Documentation ¶
Index ¶
- Variables
- func Contains(slice []string, item string) bool
- func GenerateURL(ctx context.Context, serverURL, path string, pathParams interface{}, ...) (string, error)
- func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error)
- func MatchContentType(contentType string, pattern string) bool
- func MatchStatusCodes(expectedCodes []string, statusCode int) bool
- func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{})
- func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams interface{}, ...) error
- func ReplaceParameters(stringWithParams string, params map[string]string) string
- func Retry(ctx context.Context, r Retries, action func() (*http.Response, error)) (*http.Response, error)
- func SerializeRequestBody(ctx context.Context, request interface{}, nullable, optional bool, ...) (io.Reader, string, error)
- func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, ...) error
- func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}, tag string) error
- type BackoffStrategy
- type HTTPClient
- type Retries
- type RetryConfig
- type SecurityClient
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SerializationMethodToContentType = map[string]string{
"json": "application/json",
"form": "application/x-www-form-urlencoded",
"multipart": "multipart/form-data",
"raw": "application/octet-stream",
"string": "text/plain",
}
)
Functions ¶
func GenerateURL ¶
func MarshalJSON ¶
func MatchContentType ¶
func MatchStatusCodes ¶ added in v0.3.0
func PopulateHeaders ¶
func PopulateQueryParams ¶
func ReplaceParameters ¶
func SerializeRequestBody ¶
func UnmarshalJSON ¶
Types ¶
type BackoffStrategy ¶
type Retries ¶
type Retries struct { Config *RetryConfig StatusCodes []string }
type RetryConfig ¶
type RetryConfig struct { Strategy string Backoff *BackoffStrategy RetryConnectionErrors bool }
type SecurityClient ¶
type SecurityClient struct { HTTPClient // contains filtered or unexported fields }
func ConfigureSecurityClient ¶
func ConfigureSecurityClient(c HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient
Click to show internal directories.
Click to hide internal directories.