Versions in this module Expand all Collapse all v0 v0.1.0 Jun 8, 2026 Changes in this version + var ErrBaseURLInvalid = errors.New("client: base URL must be an absolute URL") + var ErrBaseURLRequired = errors.New("client: base URL is required") + var ErrEntityPathInvalid = errors.New("client: entity path must not include query or fragment") + var ErrEntityPathRequired = errors.New("client: entity path is required") + var ErrHeaderKeyRequired = errors.New("client: header or query parameter key is required") + var ErrNilConfig = errors.New("client: http config is required") + var ErrNoTransport = errors.New("client: transport not configured") type HTTPConfig + func (c *HTTPConfig) Normalize() error v0.0.0 May 19, 2026retracted Changes in this version + type APIError struct + Body []byte + ErrorMsg string + Message string + StatusCode int + func (e *APIError) Error() string + type BulkCreateInput struct + Items []T + type BulkDeleteInput struct + IDs []string + type BulkError struct + Error string + ID string + type BulkMetadata struct + FailedCount int + SucceededCount int + TotalCount int + type BulkResponse struct + Failed []BulkError + Metadata *BulkMetadata + Succeeded []T + type BulkUpdateInput struct + Items []T + type CRUDTransport interface + BulkCreate func(ctx context.Context, input *BulkCreateInput[T]) (*BulkResponse[T], error) + BulkDelete func(ctx context.Context, ids []string) error + BulkUpdate func(ctx context.Context, input *BulkUpdateInput[T]) (*BulkResponse[T], error) + Create func(ctx context.Context, input *CreateInput[T]) (*ItemResponse[T], error) + Delete func(ctx context.Context, id string) error + Export func(ctx context.Context, params ExportParams) ([]byte, error) + GetByID func(ctx context.Context, id string) (*ItemResponse[T], error) + Import func(ctx context.Context, data []byte, format string) (*ImportResponse, error) + List func(ctx context.Context, params *ListParams) (*ListResponse[T], error) + PartialUpdate func(ctx context.Context, id string, input *PartialUpdateInput) (*ItemResponse[T], error) + Update func(ctx context.Context, id string, input *UpdateInput[T]) (*ItemResponse[T], error) + type Client struct + func NewHTTP[T any](config *HTTPConfig) (*Client[T], error) + func New[T any](transport CRUDTransport[T]) *Client[T] + func (c *Client[T]) BulkCreate(ctx context.Context, input BulkCreateInput[T]) (*BulkResponse[T], error) + func (c *Client[T]) BulkDelete(ctx context.Context, ids []string) error + func (c *Client[T]) BulkUpdate(ctx context.Context, input BulkUpdateInput[T]) (*BulkResponse[T], error) + func (c *Client[T]) Create(ctx context.Context, input CreateInput[T]) (*ItemResponse[T], error) + func (c *Client[T]) Delete(ctx context.Context, id string) error + func (c *Client[T]) Export(ctx context.Context, params ExportParams) ([]byte, error) + func (c *Client[T]) GetByID(ctx context.Context, id string) (*ItemResponse[T], error) + func (c *Client[T]) Import(ctx context.Context, data []byte, format string) (*ImportResponse, error) + func (c *Client[T]) List(ctx context.Context, params ListParams) (*ListResponse[T], error) + func (c *Client[T]) PartialUpdate(ctx context.Context, id string, input PartialUpdateInput) (*ItemResponse[T], error) + func (c *Client[T]) Transport() CRUDTransport[T] + func (c *Client[T]) Update(ctx context.Context, id string, input UpdateInput[T]) (*ItemResponse[T], error) + func (c *Client[T]) WithTransport(transport CRUDTransport[T]) *Client[T] + type Config interface + GetType func() TransportType + Validate func() error + type CreateInput struct + Body T + type ExportParams struct + Fields []string + Filter *Filter + Format string + type Filter struct + All []Filter + Any []Filter + Field string + Not *Filter + Operator string + Value any + type HTTPConfig struct + APIKey string + BaseURL string + EntityPath string + HTTPClient *http.Client + Headers map[string]string + QueryParams map[string]string + Timeout time.Duration + func NewHTTPConfig(baseURL, entityPath string, options ...Option) *HTTPConfig + func (c *HTTPConfig) GetType() TransportType + func (c *HTTPConfig) Validate() error + func (c *HTTPConfig) WithBearerToken(token string) *HTTPConfig + func (c *HTTPConfig) WithHTTPClient(client *http.Client) *HTTPConfig + func (c *HTTPConfig) WithHeader(key, value string) *HTTPConfig + func (c *HTTPConfig) WithQueryParam(key, value string) *HTTPConfig + type HTTPTransport struct + func NewHTTPTransport[T any](config *HTTPConfig) (*HTTPTransport[T], error) + func (t *HTTPTransport[T]) BulkCreate(ctx context.Context, input *BulkCreateInput[T]) (*BulkResponse[T], error) + func (t *HTTPTransport[T]) BulkDelete(ctx context.Context, ids []string) error + func (t *HTTPTransport[T]) BulkUpdate(ctx context.Context, input *BulkUpdateInput[T]) (*BulkResponse[T], error) + func (t *HTTPTransport[T]) Create(ctx context.Context, input *CreateInput[T]) (*ItemResponse[T], error) + func (t *HTTPTransport[T]) Delete(ctx context.Context, id string) error + func (t *HTTPTransport[T]) Export(ctx context.Context, params ExportParams) ([]byte, error) + func (t *HTTPTransport[T]) GetByID(ctx context.Context, id string) (*ItemResponse[T], error) + func (t *HTTPTransport[T]) Import(ctx context.Context, data []byte, format string) (*ImportResponse, error) + func (t *HTTPTransport[T]) List(ctx context.Context, params *ListParams) (*ListResponse[T], error) + func (t *HTTPTransport[T]) Name() string + func (t *HTTPTransport[T]) PartialUpdate(ctx context.Context, id string, input *PartialUpdateInput) (*ItemResponse[T], error) + func (t *HTTPTransport[T]) Type() TransportType + func (t *HTTPTransport[T]) Update(ctx context.Context, id string, input *UpdateInput[T]) (*ItemResponse[T], error) + type ImportResponse struct + Errors []string + Failed int + Imported int + type ItemResponse struct + Data T + Metadata map[string]any + type ListMetadata struct + Page int + PageSize int + TotalCount int64 + TotalPages int + type ListParams struct + Embed []string + Fields []string + Filter *Filter + IncludeDeleted bool + Offset int + Order string + Page int + PageSize int + Search string + Sort string + type ListResponse struct + Data []T + Metadata *ListMetadata + type Option func(*HTTPConfig) + func WithAPIKey(apiKey string) Option + func WithBearerToken(token string) Option + func WithHeader(key, value string) Option + func WithQueryParam(key, value string) Option + func WithTimeout(timeout time.Duration) Option + type PartialUpdateInput struct + ID string + Updates map[string]any + type Transport interface + Name func() string + Type func() TransportType + type TransportType string + const TransportTypeHTTP + type UpdateInput struct + Body T + ID string