Documentation ¶
Index ¶
- Variables
- func Delete[T any](url string, rawBody []byte, timeout time.Duration, ...) (res T, err error)
- func Get[T any](url string, timeout time.Duration, reqInterceptor RequestInterceptor, ...) (res T, err error)
- func Patch[T any](url string, rawBody []byte, timeout time.Duration, ...) (res T, err error)
- func Post[T any](url string, rawBody []byte, timeout time.Duration, ...) (res T, err error)
- func Put[T any](url string, rawBody []byte, timeout time.Duration, ...) (res T, err error)
- func SendRequest(method string, url string, body []byte, timeout time.Duration, ...) (rawBody []byte, err error)
- func SetClient(c Client)
- type Client
- type DefaultResponse
- type ReqError
- type RequestInterceptor
- type ResponseInterceptor
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultTimeout = time.Duration(4000) * time.Millisecond
)
Functions ¶
func Delete ¶
func Delete[T any](url string, rawBody []byte, timeout time.Duration, reqInterceptor RequestInterceptor, resInterceptor ResponseInterceptor) (res T, err error)
func Get ¶
func Get[T any](url string, timeout time.Duration, reqInterceptor RequestInterceptor, resInterceptor ResponseInterceptor) (res T, err error)
func Patch ¶
func Patch[T any](url string, rawBody []byte, timeout time.Duration, reqInterceptor RequestInterceptor, resInterceptor ResponseInterceptor) (res T, err error)
func Post ¶
func Post[T any](url string, rawBody []byte, timeout time.Duration, reqInterceptor RequestInterceptor, resInterceptor ResponseInterceptor) (res T, err error)
func Put ¶
func Put[T any](url string, rawBody []byte, timeout time.Duration, reqInterceptor RequestInterceptor, resInterceptor ResponseInterceptor) (res T, err error)
func SendRequest ¶
func SendRequest(method string, url string, body []byte, timeout time.Duration, reqInterceptor RequestInterceptor, resInterceptor ResponseInterceptor) (rawBody []byte, err error)
Types ¶
type DefaultResponse ¶
type DefaultResponse struct {
Message string `json:"message"`
}
type RequestInterceptor ¶
type ResponseInterceptor ¶
Click to show internal directories.
Click to hide internal directories.