Documentation ¶
Index ¶
- func CommonResponse[RES any]() client.ResponseBodyCheck
- func Delete[RES any](url string, param any) (*RES, error)
- func Get[RES any](url string, param any) (*RES, error)
- func GetSubData[RES ResponseInterface[T], T any](url string, param any) (T, error)
- func GetWithOption[RES ResponseInterface[T], T any](url string, param any, options ...client.Option) (T, error)
- func Post[RES any](url string, param any) (*RES, error)
- func Put[RES any](url string, param any) (*RES, error)
- type Request
- func DeleteRequest[RES any](url string) *Request[RES]
- func GetRequest[RES any](url string) *Request[RES]
- func NewRequest[RES any](method, url string) *Request[RES]
- func NewRequestFromV1[RES any](req *client.Request) *Request[RES]
- func PostRequest[RES any](url string) *Request[RES]
- func PutRequest[RES any](url string) *Request[RES]
- func (req *Request[RES]) AddHeader(k, v string) *Request[RES]
- func (req *Request[RES]) ContentType(contentType client.ContentType) *Request[RES]
- func (req *Request[RES]) Context(ctx context.Context) *Request[RES]
- func (r *Request[RES]) Do(param any) (*RES, error)
- func (req *Request[RES]) DoNoParam() (*RES, error)
- func (req *Request[RES]) Header(header httpi.Header) *Request[RES]
- func (r *Request[RES]) Origin() *client.Request
- func (req *Request[RES]) SetClient(set func(c *client.Client)) *Request[RES]
- func (req *Request[RES]) WithClient(client2 *client.Client) *Request[RES]
- type ResData
- type ResponseInterface
- type SubDataRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonResponse ¶
func CommonResponse[RES any]() client.ResponseBodyCheck
func GetSubData ¶
func GetSubData[RES ResponseInterface[T], T any](url string, param any) (T, error)
func GetWithOption ¶
Types ¶
type Request ¶
func DeleteRequest ¶
func GetRequest ¶
func NewRequest ¶
func NewRequestFromV1 ¶ added in v0.0.33
func PostRequest ¶
func PutRequest ¶
func (*Request[RES]) ContentType ¶
func (req *Request[RES]) ContentType(contentType client.ContentType) *Request[RES]
type ResData ¶ added in v0.0.33
func (*ResData[RES]) CheckError ¶ added in v0.0.33
type ResponseInterface ¶
type ResponseInterface[T any] interface { client.ResponseBodyCheck SubData() T }
type SubDataRequest ¶
type SubDataRequest[RES ResponseInterface[T], T any] Request[RES]
一个语法糖,一般不用
func NewSubDataRequest ¶
func NewSubDataRequest[RES ResponseInterface[T], T any](req *client.Request) *SubDataRequest[RES, T]
func (*SubDataRequest[RES, T]) Do ¶
func (r *SubDataRequest[RES, T]) Do(param any) (T, error)
Do create a HTTP request
func (*SubDataRequest[RES, T]) Origin ¶
func (req *SubDataRequest[RES, T]) Origin() *client.Request
func (*SubDataRequest[RES, T]) SubData ¶
func (req *SubDataRequest[RES, T]) SubData(param any) (T, error)
Click to show internal directories.
Click to hide internal directories.