Documentation
¶
Index ¶
Constants ¶
View Source
const ChromaGoClientUserAgent = "chroma-go-client/0.1.x"
View Source
const MaxResponseBodySize = 200 * 1024 * 1024
MaxResponseBodySize is the maximum allowed response body size (200 MB).
Variables ¶
This section is empty.
Functions ¶
func ReadLimitedBody ¶ added in v0.3.3
ReadLimitedBody reads up to MaxResponseBodySize bytes from r. Returns an error if the response exceeds the limit.
func ReadRespBody ¶
Types ¶
type ChromaError ¶
type ChromaError struct {
ErrorID string `json:"error"`
ErrorCode int `json:"error_code"`
Message string `json:"message"`
}
ChromaError represents an error returned by the Chroma API. It contains the ID of the error, the error message and the status code from the HTTP call. Example:
{
"error": "NotFoundError",
"message": "Tenant default_tenant2 not found"
}
func ChromaErrorFromHTTPResponse ¶
func ChromaErrorFromHTTPResponse(resp *http.Response, err error) *ChromaError
func (*ChromaError) Error ¶
func (e *ChromaError) Error() string
type Option ¶
type Option func(*SimpleRetryStrategy) error
func WithExponentialBackOff ¶
func WithExponentialBackOff() Option
func WithFixedDelay ¶
func WithMaxRetries ¶
type RetryStrategy ¶
type SimpleRetryStrategy ¶
type SimpleRetryStrategy struct {
MaxRetries int
FixedDelay time.Duration
ExponentialBackOff bool
RetryableStatusCodes []int
}
func NewSimpleRetryStrategy ¶
func NewSimpleRetryStrategy(opts ...Option) (*SimpleRetryStrategy, error)
func (*SimpleRetryStrategy) DoWithRetry ¶
Click to show internal directories.
Click to hide internal directories.