Versions in this module Expand all Collapse all v1 v1.1.0 Mar 24, 2026 v1.0.0 Dec 17, 2025 Changes in this version + const OpEqual + const OpGreaterEqual + const OpGreaterThan + const OpLessEqual + const OpLessThan + const OpLike + const OpNotEqual + var ErrEmptyEntryID = errors.New("remedy: entry ID cannot be empty") + var ErrEmptyFormName = errors.New("remedy: form name cannot be empty") + var ErrForbidden = errors.New("remedy: forbidden") + var ErrNoCredentials = errors.New("remedy: no credentials stored for token refresh") + var ErrNotAuthenticated = errors.New("remedy: not authenticated") + var ErrNotFound = errors.New("remedy: not found") + var ErrTokenTooLarge = errors.New("remedy: token too large") + var ErrUnauthorized = errors.New("remedy: unauthorized") + type APIError struct + MessageAppendedText string + MessageNumber int + MessageText string + MessageType string + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type AttachmentServicer interface + Get func(ctx context.Context, form, entryID, fieldName string) (io.ReadCloser, error) + Upload func(ctx context.Context, form, entryID, fieldName, filename string, data io.Reader) error + type Client struct + func New(baseURL string, opts ...Option) *Client + func (c *Client) Attachments() AttachmentServicer + func (c *Client) ClearCredentials() + func (c *Client) Close() + func (c *Client) Entries() EntryServicer + func (c *Client) IsAuthenticated() bool + func (c *Client) Login(ctx context.Context, username, password string) error + func (c *Client) LoginWithAuth(ctx context.Context, username, password, authString string) error + func (c *Client) Logout(ctx context.Context) error + type DeleteOption string + const DeleteOptionForce + const DeleteOptionNoCascade + const DeleteOptionNone + type Entry struct + Links []Link + Values map[string]any + type EntryList struct + Entries []Entry + Links []Link + type EntryServicer interface + Create func(ctx context.Context, form string, values map[string]any) (*Entry, error) + Delete func(ctx context.Context, form, entryID string, opts ...DeleteOption) error + Get func(ctx context.Context, form, entryID string, opts ...QueryOption) (*Entry, error) + List func(ctx context.Context, form string, opts ...QueryOption) (*EntryList, error) + Merge func(ctx context.Context, form string, values map[string]any) (*Entry, error) + Update func(ctx context.Context, form, entryID string, values map[string]any) error + type Field struct + DataType string + ID int + Name string + type HTTPDoer interface + Do func(req *http.Request) (*http.Response, error) + type Link struct + Href string + Rel string + type Option func(*Client) + func WithAutoRefresh(enabled bool) Option + func WithHTTPClient(httpClient HTTPDoer) Option + func WithRateLimit(requestsPerSecond float64) Option + func WithRefreshThreshold(d time.Duration) Option + func WithTimeout(d time.Duration) Option + func WithTokenLifetime(d time.Duration) Option + type Query struct + func NewQuery() *Query + func (q *Query) And(field, op string, value any) *Query + func (q *Query) AndSafe(field, op string, value any) *Query + func (q *Query) Build() string + func (q *Query) BuildSafe() (string, error) + func (q *Query) Or(field, op string, value any) *Query + func (q *Query) OrSafe(field, op string, value any) *Query + func (q *Query) Raw(qualification string) *Query + type QueryOption func(*queryOptions) + func WithExpand(associations ...string) QueryOption + func WithFields(fields ...string) QueryOption + func WithLimit(limit int) QueryOption + func WithOffset(offset int) QueryOption + func WithQualification(q string) QueryOption + func WithSort(field string, order SortOrder) QueryOption + type RemedyClient interface + Attachments func() AttachmentServicer + Entries func() EntryServicer + Login func(ctx context.Context, username, password string) error + LoginWithAuth func(ctx context.Context, username, password, authString string) error + Logout func(ctx context.Context) error + type SortOrder string + const SortAsc + const SortDesc