Versions in this module Expand all Collapse all v0 v0.3.0 Nov 9, 2025 v0.2.0 Oct 24, 2025 Changes in this version + const DefaultBaseURL + const DefaultJWTAudience + const DefaultOAuthTokenEndpoint + const ScopeBusinessAPI + const ScopeSchoolAPI + var ErrAuthFailed = fmt.Errorf("authentication failed") + var ErrInvalidCursor = fmt.Errorf("invalid pagination cursor") + var ErrInvalidResponse = fmt.Errorf("invalid response format") + var ErrNoNextPage = fmt.Errorf("no next page available") + var ErrRateLimited = fmt.Errorf("rate limit exceeded") + func HasNextPage(links *Links) bool + func HasPrevPage(links *Links) bool + func LoadPrivateKeyFromEnv() (any, error) + func LoadPrivateKeyFromFile(filePath string) (any, error) + func ParsePrivateKey(keyData []byte) (any, error) + func ValidatePrivateKey(privateKey any) error + type APIError struct + Code string + Detail string + ID string + Links *ErrorLinks + Meta *APIErrorMeta + Source *APIErrorSource + Status string + Title string + func (e *APIError) Error() string + type APIErrorMeta struct + AdditionalProperties map[string]any + func (m *APIErrorMeta) MarshalJSON() ([]byte, error) + func (m *APIErrorMeta) UnmarshalJSON(data []byte) error + type APIErrorResponse struct + Details map[string]any + ErrorCode string + Message string + type APIErrorSource struct + JsonPointer *JsonPointer + Parameter *Parameter + type APIKeyAuth struct + func NewAPIKeyAuth(apiKey, header string) *APIKeyAuth + func (a *APIKeyAuth) ApplyAuth(req *resty.Request) error + type APIResponse struct + Data []T + Links Links + Meta Meta + type AuthProvider interface + ApplyAuth func(req *resty.Request) error + type Client struct + func NewTransport(config Config) (*Client, error) + func NewTransportFromEnv() (*Client, error) + func NewTransportFromFile(keyID, issuerID, privateKeyPath string) (*Client, error) + func (c *Client) ApplyOptions(opts ...ClientOptionFunc) error + func (c *Client) Close() error + func (c *Client) Delete(ctx context.Context, path string, queryParams map[string]string, ...) error + func (c *Client) DeleteWithBody(ctx context.Context, path string, body any, headers map[string]string, ...) error + func (c *Client) Get(ctx context.Context, path string, queryParams map[string]string, ...) error + func (c *Client) GetAllPages(ctx context.Context, path string, queryParams map[string]string, ...) error + func (c *Client) GetHTTPClient() *resty.Client + func (c *Client) GetNextPage(ctx context.Context, nextURL string, headers map[string]string, result any) error + func (c *Client) GetPaginated(ctx context.Context, path string, queryParams map[string]string, ...) error + func (c *Client) Patch(ctx context.Context, path string, body any, headers map[string]string, ...) error + func (c *Client) Post(ctx context.Context, path string, body any, headers map[string]string, ...) error + func (c *Client) PostMultipart(ctx context.Context, path string, files map[string]string, ...) error + func (c *Client) PostWithQuery(ctx context.Context, path string, queryParams map[string]string, body any, ...) error + func (c *Client) Put(ctx context.Context, path string, body any, headers map[string]string, ...) error + func (c *Client) QueryBuilder() interfaces.ServiceQueryBuilder + type ClientOptionFunc func(*Client) error + func WithAuth(auth AuthProvider) ClientOptionFunc + func WithBaseURL(urlStr string) ClientOptionFunc + func WithDebug(debug bool) ClientOptionFunc + func WithErrorHandler(handler *ErrorHandler) ClientOptionFunc + func WithLogger(logger *zap.Logger) ClientOptionFunc + func WithProxy(proxyURL string) ClientOptionFunc + func WithRetryCount(retryCount int) ClientOptionFunc + func WithRetryMaxWaitTime(maxWait time.Duration) ClientOptionFunc + func WithRetryWaitTime(retryWait time.Duration) ClientOptionFunc + func WithTimeout(timeout time.Duration) ClientOptionFunc + func WithUserAgent(userAgent string) ClientOptionFunc + type Config struct + Auth AuthProvider + BaseURL string + Debug bool + Logger *zap.Logger + RetryCount int + RetryWait time.Duration + Timeout time.Duration + UserAgent string + type ErrorHandler struct + func NewErrorHandler(logger *zap.Logger) *ErrorHandler + func (eh *ErrorHandler) HandleError(resp *resty.Response, errorResp *ErrorResponse) error + type ErrorLinks struct + About string + Associated *ErrorLinksAssociated + type ErrorLinksAssociated struct + Href string + Meta *ErrorLinksAssociatedMeta + type ErrorLinksAssociatedMeta struct + AdditionalProperties map[string]any + func (m *ErrorLinksAssociatedMeta) MarshalJSON() ([]byte, error) + func (m *ErrorLinksAssociatedMeta) UnmarshalJSON(data []byte) error + type ErrorResponse struct + Errors []APIError + type JWTAuth struct + func NewJWTAuth(config JWTAuthConfig) *JWTAuth + func (j *JWTAuth) ApplyAuth(req *resty.Request) error + func (j *JWTAuth) ForceRefresh() + type JWTAuthConfig struct + Audience string + IssuerID string + KeyID string + PrivateKey any + Scope string + type JsonPointer struct + Pointer string + type Links struct + First string + Last string + Next string + Prev string + Self string + type Meta struct + Paging *Paging + type PaginationOptions struct + Cursor string + Limit int + func (opts *PaginationOptions) AddToQueryBuilder(qb interfaces.ServiceQueryBuilder) interfaces.ServiceQueryBuilder + type Paging struct + Limit int + NextCursor string + Total int + type Parameter struct + Parameter string + type QueryBuilder struct + func NewQueryBuilder() *QueryBuilder + func (qb *QueryBuilder) AddBool(key string, value bool) interfaces.QueryBuilder + func (qb *QueryBuilder) AddCustom(key, value string) interfaces.QueryBuilder + func (qb *QueryBuilder) AddIfNotEmpty(key, value string) interfaces.QueryBuilder + func (qb *QueryBuilder) AddIfTrue(condition bool, key, value string) interfaces.QueryBuilder + func (qb *QueryBuilder) AddInt(key string, value int) interfaces.QueryBuilder + func (qb *QueryBuilder) AddInt64(key string, value int64) interfaces.QueryBuilder + func (qb *QueryBuilder) AddIntSlice(key string, values []int) interfaces.QueryBuilder + func (qb *QueryBuilder) AddString(key, value string) interfaces.QueryBuilder + func (qb *QueryBuilder) AddStringSlice(key string, values []string) interfaces.QueryBuilder + func (qb *QueryBuilder) AddTime(key string, value time.Time) interfaces.QueryBuilder + func (qb *QueryBuilder) Build() map[string]string + func (qb *QueryBuilder) BuildString() string + func (qb *QueryBuilder) Clear() interfaces.QueryBuilder + func (qb *QueryBuilder) Count() int + func (qb *QueryBuilder) Get(key string) string + func (qb *QueryBuilder) Has(key string) bool + func (qb *QueryBuilder) IsEmpty() bool + func (qb *QueryBuilder) Merge(other map[string]string) interfaces.QueryBuilder + func (qb *QueryBuilder) Remove(key string) interfaces.QueryBuilder + type TokenResponse struct + AccessToken string + ExpiresIn int + Scope string + TokenType string