Documentation
¶
Overview ¶
internal/api/client.go
Index ¶
Constants ¶
View Source
const DefaultUploadTimeout = 10 * time.Minute
DefaultUploadTimeout is the default upload timeout when the caller does not provide one. It covers the full request (including body streaming), so it must be generous enough for tens-of-MB uploads across a slow reverse proxy.
View Source
const PathPrefix = "/api"
PathPrefix is the API path prefix appended to the base server URL.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles communication with the OCAP web frontend.
func NewWithConfig ¶
func NewWithConfig(baseURL, apiKey string, cfg ClientConfig) *Client
NewWithConfig creates a new API client with custom configuration.
func (*Client) Healthcheck ¶
Healthcheck checks if the OCAP web frontend is reachable.
type ClientConfig ¶
type ClientConfig struct {
// UploadTimeout is the maximum duration for the total upload request
// (including streaming the body). Defaults to DefaultUploadTimeout.
UploadTimeout time.Duration
}
ClientConfig configures the API client. All fields are optional — zero values resolve to sensible defaults.
Click to show internal directories.
Click to hide internal directories.