Documentation ¶
Index ¶
- Variables
- type Client
- 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, *resty.Response)
- func (c *Client) Update(collection string, id string, body any) error
- type ClientOption
- type Collection
- 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]) 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
- type ParamsList
- type ResponseCreate
- type ResponseList
- type Stream
- type SubscribeOptions
- type SubscriptionsSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidResponse = errors.New("invalid response")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(url string, opts ...ClientOption) *Client
func (*Client) Create ¶
func (c *Client) Create(collection string, body any) (ResponseCreate, error)
func (*Client) List ¶
func (c *Client) List(collection string, params ParamsList) (ResponseList[map[string]any], error, *resty.Response)
type ClientOption ¶
type ClientOption func(*Client)
func WithAdminEmailPassword ¶
func WithAdminEmailPassword(email, password string) ClientOption
func WithDebug ¶
func WithDebug() ClientOption
func WithUserEmailPassword ¶
func WithUserEmailPassword(email, password string) ClientOption
type Collection ¶
func CollectionSet ¶
func CollectionSet[T any](client *Client, collection string) Collection[T]
func (Collection[T]) Create ¶
func (c Collection[T]) Create(body T) (ResponseCreate, error)
func (Collection[T]) Delete ¶
func (c Collection[T]) Delete(id string) error
func (Collection[T]) List ¶
func (c Collection[T]) List(params ParamsList) (ResponseList[T], error)
func (Collection[T]) One ¶
func (c Collection[T]) One(id string) (T, error)
func (Collection[T]) Subscribe ¶
func (c Collection[T]) Subscribe(targets ...string) (*Stream[T], error)
func (Collection[T]) SubscribeWith ¶
func (c Collection[T]) SubscribeWith(opts SubscribeOptions, targets ...string) (*Stream[T], error)
func (Collection[T]) Update ¶
func (c Collection[T]) Update(id string, body T) error
type ParamsList ¶
type ResponseCreate ¶
type ResponseList ¶
type Stream ¶
type Stream[T any] struct { // contains filtered or unexported fields }
func (*Stream[T]) Unsubscribe ¶
func (s *Stream[T]) Unsubscribe()
func (*Stream[T]) WaitAuthReady
deprecated
type SubscribeOptions ¶
type SubscribeOptions struct {
ReconnectStrategy backoff.BackOff
}
type SubscriptionsSet ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.