Documentation
¶
Overview ¶
Package api provides the HTTP client for the Life@USTC API.
Index ¶
- type APIError
- type Client
- func (c *Client) Delete(path string, params url.Values) (any, error)
- func (c *Client) Get(path string, params url.Values) (any, error)
- func (c *Client) GetRaw(path string, params url.Values) (*http.Response, error)
- func (c *Client) Patch(path string, body any) (any, error)
- func (c *Client) Post(path string, body any) (any, error)
- func (c *Client) PostForm(endpoint string, data url.Values) (map[string]any, error)
- func (c *Client) Put(path string, body any) (any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Server string
Cred *config.Credential
HTTPClient *http.Client
}
Client wraps net/http with automatic auth header injection and token refresh.
Click to show internal directories.
Click to hide internal directories.