Versions in this module Expand all Collapse all v0 v0.1.1 Jul 30, 2026 v0.1.0 Jul 25, 2026 Changes in this version + var ErrCanceled = errors.New("request canceled") + var ErrDecode = errors.New("response decode failure") + var ErrEmptyUserID = errors.New("user id cannot be empty") + var ErrForbidden = errors.New("forbidden") + var ErrHTTPStatus = errors.New("unexpected http status") + var ErrInvalidCollectionType = errors.New("invalid collection type") + var ErrInvalidConfiguration = errors.New("invalid client configuration") + var ErrInvalidSubjectType = errors.New("invalid subject type") + var ErrInvalidUserID = errors.New("invalid user id") + var ErrNilContext = errors.New("nil context") + var ErrNoCollectionTypes = errors.New("no collection types") + var ErrNotFound = errors.New("not found") + var ErrProtocol = errors.New("response protocol violation") + var ErrRateLimited = errors.New("rate limited") + var ErrResponseTooLarge = errors.New("response too large") + var ErrRetryExhausted = errors.New("retry exhausted") + var ErrServerError = errors.New("server error") + var ErrTimeout = errors.New("request timeout") + var ErrTransport = errors.New("transport failure") + var ErrUnauthorized = errors.New("unauthorized") + type Client struct + func NewClient(userAgent string, options ...Option) *Client + func (c *Client) Fetch(ctx context.Context, userID string, subjectType SubjectType, ...) ([]*Subject, error) + func (c *Client) FetchPage(ctx context.Context, userID string, subjectType SubjectType, ...) (*PageResult, error) + type CollectionType int + const CollectionTypeDoing + const CollectionTypeDone + const CollectionTypeDropped + const CollectionTypeOnHold + const CollectionTypeWish + type DecodeError struct + func (e *DecodeError) Error() string + func (e *DecodeError) Unwrap() error + type HTTPError struct + Body string + RetryAfter time.Duration + StatusCode int + func (e *HTTPError) Error() string + func (e *HTTPError) Is(target error) bool + type NetworkError struct + Err error + Timeout bool + func (e *NetworkError) Error() string + func (e *NetworkError) Is(target error) bool + func (e *NetworkError) Unwrap() error + type Option func(*Client) + func WithConcurrencyLimit(limit int) Option + func WithEndpoint(endpoint string) Option + func WithHTTPClient(client *http.Client) Option + func WithMaxRetries(maxRetries int) Option + func WithMaxRetryDelay(delay time.Duration) Option + func WithRateLimit(requestsPerSecond float64, burst int) Option + func WithRequestTimeout(timeout time.Duration) Option + func WithRetryInterval(interval time.Duration) Option + type PageResult struct + Data []*Subject + Limit int + Offset int + Total int + type ProtocolError struct + func (e *ProtocolError) Error() string + func (e *ProtocolError) Unwrap() error + type RetryError struct + Attempts int + Err error + func (e *RetryError) Error() string + func (e *RetryError) Is(target error) bool + func (e *RetryError) Unwrap() error + type Subject struct + Comment string + EpStatus int + ID int + Name string + NameCn string + Private bool + Rate int + SubjectID int + SubjectType SubjectType + Tags []string + Type CollectionType + UpdatedAt time.Time + VolStatus int + type SubjectType int + const SubjectTypeAnime + const SubjectTypeBook + const SubjectTypeGame + const SubjectTypeMusic + const SubjectTypeReal