Documentation ¶
Index ¶
- type RequestOption
- type RestClient
- func (rc *RestClient) Delete(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
- func (rc *RestClient) Get(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
- func (rc *RestClient) Patch(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
- func (rc *RestClient) Post(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
- func (rc *RestClient) Put(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestOption ¶
type RequestOption func(*requestOptions)
func WithBody ¶
func WithBody(b []byte) RequestOption
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
func NewRestClient ¶
func NewRestClient(token string, cli *http.Client) *RestClient
func (*RestClient) Delete ¶
func (rc *RestClient) Delete(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
func (*RestClient) Get ¶
func (rc *RestClient) Get(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
func (*RestClient) Patch ¶
func (rc *RestClient) Patch(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
func (*RestClient) Post ¶
func (rc *RestClient) Post(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
func (*RestClient) Put ¶
func (rc *RestClient) Put(ctx context.Context, url string, v interface{}, opts ...RequestOption) error
Click to show internal directories.
Click to hide internal directories.