Documentation
¶
Index ¶
- type AlpaconClient
- func (ac *AlpaconClient) IsUsingHTTPS() (bool, error)
- func (ac *AlpaconClient) LoadCurrentUser() error
- func (ac *AlpaconClient) RefreshToken() error
- func (ac *AlpaconClient) SendDeleteRequest(url string) ([]byte, error)
- func (ac *AlpaconClient) SendGetRequest(url string) ([]byte, error)
- func (ac *AlpaconClient) SendGetRequestForDownload(url string) (*http.Response, error)
- func (ac *AlpaconClient) SendGetRequestToURL(absoluteURL string) ([]byte, error)
- func (ac *AlpaconClient) SendMultipartStreamRequest(url, contentType string, body io.Reader, contentLength int64) ([]byte, error)
- func (ac *AlpaconClient) SendPatchRequest(url string, body any) ([]byte, error)
- func (ac *AlpaconClient) SendPostRequest(url string, body any) ([]byte, error)
- func (ac *AlpaconClient) SetWebsocketHeader() http.Header
- type CheckPrivilegesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlpaconClient ¶
type AlpaconClient struct {
HTTPClient *http.Client
BaseURL string
Token string
AccessToken string
Privileges string
Username string
UserAgent string
// contains filtered or unexported fields
}
func NewAlpaconAPIClient ¶
func NewAlpaconAPIClient() (*AlpaconClient, error)
func (*AlpaconClient) IsUsingHTTPS ¶
func (ac *AlpaconClient) IsUsingHTTPS() (bool, error)
func (*AlpaconClient) LoadCurrentUser ¶ added in v1.4.8
func (ac *AlpaconClient) LoadCurrentUser() error
func (*AlpaconClient) RefreshToken ¶ added in v1.3.0
func (ac *AlpaconClient) RefreshToken() error
RefreshToken refreshes the access token using the stored refresh token. Uses ac.BaseURL (not config's WorkspaceURL) to stay consistent with the client's target.
func (*AlpaconClient) SendDeleteRequest ¶
func (ac *AlpaconClient) SendDeleteRequest(url string) ([]byte, error)
func (*AlpaconClient) SendGetRequest ¶
func (ac *AlpaconClient) SendGetRequest(url string) ([]byte, error)
Get Request to Alpacon Server
func (*AlpaconClient) SendGetRequestForDownload ¶
func (ac *AlpaconClient) SendGetRequestForDownload(url string) (*http.Response, error)
SendGetRequestForDownload returns the raw *http.Response so callers can stream the body. Auth errors (401/403) are handled here; all other status codes are left to the caller.
func (*AlpaconClient) SendGetRequestToURL ¶ added in v1.4.2
func (ac *AlpaconClient) SendGetRequestToURL(absoluteURL string) ([]byte, error)
SendGetRequestToURL sends a GET request to an absolute URL (e.g., an external service) using the client's authentication headers.
func (*AlpaconClient) SendMultipartStreamRequest ¶ added in v1.5.0
func (*AlpaconClient) SendPatchRequest ¶
func (ac *AlpaconClient) SendPatchRequest(url string, body any) ([]byte, error)
func (*AlpaconClient) SendPostRequest ¶
func (ac *AlpaconClient) SendPostRequest(url string, body any) ([]byte, error)
POST Request to Alpacon Server
func (*AlpaconClient) SetWebsocketHeader ¶
func (ac *AlpaconClient) SetWebsocketHeader() http.Header
type CheckPrivilegesResponse ¶
Click to show internal directories.
Click to hide internal directories.