Versions in this module Expand all Collapse all v0 v0.0.2 Feb 26, 2024 Changes in this version + var ErrInvalidResponse = errors.New("invalid response") + type Client struct + func NewClient(url string, opts ...ClientOption) *Client + func (c *Client) AuthStore() authStore + func (c *Client) Authorize() error + func (c *Client) Create(collection string, body any) (ResponseCreate, error) + func (c *Client) Delete(collection string, id string) error + func (c *Client) List(collection string, params ParamsList) (ResponseList[map[string]any], error) + func (c *Client) Update(collection string, id string, body any) error + type ClientOption func(*Client) + func WithAdminEmailPassword(email, password string) ClientOption + func WithAdminToken(token string) ClientOption + func WithDebug() ClientOption + func WithEmailPassword(collection, email, password string) ClientOption + func WithUserEmailPassword(email, password string) ClientOption + func WithUserToken(token string) ClientOption + type Collection struct + Name string + func CollectionSet[T any](client *Client, collection string) Collection[T] + func (c Collection[T]) Create(body T) (ResponseCreate, error) + func (c Collection[T]) Delete(id string) error + func (c Collection[T]) List(params ParamsList) (ResponseList[T], error) + func (c Collection[T]) One(id string) (T, error) + func (c Collection[T]) OneWithParams(id string, params ParamsList) (T, error) + func (c Collection[T]) Subscribe(targets ...string) (*Stream[T], error) + func (c Collection[T]) SubscribeWith(opts SubscribeOptions, targets ...string) (*Stream[T], error) + func (c Collection[T]) Update(id string, body T) error + type Event struct + Action string + Error error + Record T + type ParamsList struct + Expand string + Fields string + Filters string + Page int + Size int + Sort string + type ResponseCreate struct + Created string + Field string + ID string + Updated string + type ResponseList struct + Items []T + Page int + PerPage int + TotalItems int + TotalPages int + type Stream struct + func (s *Stream[T]) Events() <-chan Event[T] + func (s *Stream[T]) Ready() <-chan struct{} + func (s *Stream[T]) Unsubscribe() + func (s *Stream[T]) WaitAuthReady() error + type SubscribeOptions struct + ReconnectStrategy backoff.BackOff + type SubscriptionsSet struct + ClientID string + Subscriptions []string