Documentation ¶
Index ¶
- Variables
- func AsSecuritySource(security interface{}) func(context.Context) (interface{}, error)
- func ConsumeRawBody(res *http.Response) ([]byte, error)
- func Contains(slice []string, item string) bool
- func GenerateURL(_ context.Context, serverURL, path string, pathParams interface{}, ...) (string, error)
- func GetEnv(name, defaultValue string) string
- 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(_ context.Context, req *http.Request, headers interface{}, globals interface{})
- func PopulateQueryParams(_ context.Context, req *http.Request, queryParams interface{}, ...) error
- func PopulateSecurity(ctx context.Context, req *http.Request, ...) error
- func ReplaceParameters(stringWithParams string, params map[string]string) string
- func Retry(ctx context.Context, r Retries, operation func() (*http.Response, error)) (*http.Response, error)
- func SerializeRequestBody(_ 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 BackoffStrategydeprecated
- type Retries
- type RetryConfigdeprecated
- type Timer
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 AsSecuritySource ¶ added in v3.8.2
func GenerateURL ¶
func GetEnv ¶ added in v3.16.0
GetEnv returns the value of the environment variable named by the key or the defaultValue if the environment variable is not set.
func MarshalJSON ¶
func MatchContentType ¶
func MatchStatusCodes ¶ added in v3.3.0
func PopulateHeaders ¶
func PopulateQueryParams ¶
func PopulateSecurity ¶ added in v3.4.0
func ReplaceParameters ¶
func SerializeRequestBody ¶
func UnmarshalJSON ¶
Types ¶
type BackoffStrategy
deprecated
type BackoffStrategy = retry.BackoffStrategy
Deprecated: Use retry.BackoffStrategy instead.
type RetryConfig
deprecated
Click to show internal directories.
Click to hide internal directories.