Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) AddRequest(body types.AddRequestBodyType) (any, error)
- func (c *Client) Authorize() error
- func (c *Client) CompleteProcess(id string, message string) error
- func (c *Client) Create(collection string, body any) (types.ResponseCreate, error)
- func (c *Client) CreateCollection(body any) (any, error)
- func (c *Client) CreateProcess(req CreateProcessRequest) (string, error)
- func (c *Client) Delete(collection string, id string) error
- func (c *Client) FailProcess(id string, errorMsg string) error
- func (c *Client) KillProcess(id string, message string) error
- func (c *Client) LabelAttach(data types.Label) error
- func (c *Client) List(collection string, params types.ParamsList) (types.ResponseList[map[string]any], error)
- func (c *Client) PauseProcess(id string, message string) error
- func (c *Client) PlaygroundAddChild(body types.PlaygroundAdd) (any, error)
- func (c *Client) PlaygroundNew(body types.PlaygroundNew) (any, error)
- func (c *Client) SitemapNew(data types.SitemapGet) error
- func (c *Client) Update(collection string, id string, body any) error
- func (c *Client) UpdateProcess(id string, progress ProgressUpdate) error
- type ClientOption
- type Collection
- func (c Collection[T]) Create(body T) (types.ResponseCreate, error)
- func (c Collection[T]) Delete(id string) error
- func (c Collection[T]) List(params types.ParamsList) (types.ResponseList[T], error)
- func (c Collection[T]) One(id string) (T, error)
- func (c Collection[T]) SitemapNew(data types.SitemapGet) 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 CreateProcessRequest
- type Event
- type ProcessInput
- type ProgressUpdate
- type Stream
- type SubscribeOptions
- type SubscriptionsSet
- type UpdateProcessRequest
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) AddRequest ¶
func (c *Client) AddRequest(body types.AddRequestBodyType) (any, error)
func (*Client) CompleteProcess ¶
CompleteProcess marks a process as completed
func (*Client) CreateProcess ¶
func (c *Client) CreateProcess(req CreateProcessRequest) (string, error)
CreateProcess creates a new process in the _processes collection
func (*Client) FailProcess ¶
FailProcess marks a process as failed with an error message
func (*Client) KillProcess ¶
KillProcess marks a process as killed
func (*Client) List ¶
func (c *Client) List(collection string, params types.ParamsList) (types.ResponseList[map[string]any], error)
func (*Client) PauseProcess ¶
PauseProcess marks a process as paused
func (*Client) PlaygroundAddChild ¶
func (c *Client) PlaygroundAddChild(body types.PlaygroundAdd) (any, error)
func (*Client) PlaygroundNew ¶
func (c *Client) PlaygroundNew(body types.PlaygroundNew) (any, error)
func (*Client) SitemapNew ¶
func (c *Client) SitemapNew(data types.SitemapGet) error
Sitemap New using endpoint form APIEndpoints[SitemapNew]
func (*Client) UpdateProcess ¶
func (c *Client) UpdateProcess(id string, progress ProgressUpdate) error
UpdateProcess updates an existing process with progress information
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) (types.ResponseCreate, error)
func (Collection[T]) Delete ¶
func (c Collection[T]) Delete(id string) error
func (Collection[T]) List ¶
func (c Collection[T]) List(params types.ParamsList) (types.ResponseList[T], error)
func (Collection[T]) One ¶
func (c Collection[T]) One(id string) (T, error)
func (Collection[T]) SitemapNew ¶
func (c Collection[T]) SitemapNew(data types.SitemapGet) 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 CreateProcessRequest ¶
type CreateProcessRequest struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
State string `json:"state,omitempty"`
Data map[string]any `json:"data,omitempty"`
Input *ProcessInput `json:"input,omitempty"`
ParentID string `json:"parent_id,omitempty"`
GeneratedBy string `json:"generated_by,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
}
CreateProcessRequest represents the request to create a new process
type ProcessInput ¶
type ProcessInput struct {
Completed int `json:"completed"`
Total int `json:"total"`
Progress int `json:"progress"`
Message string `json:"message"`
Error string `json:"error"`
}
ProcessInput represents the input field structure for a process
type ProgressUpdate ¶
ProgressUpdate represents progress information for updating a process
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 SubscriptionsSet ¶
type UpdateProcessRequest ¶
type UpdateProcessRequest struct {
Input *ProcessInput `json:"input,omitempty"`
State string `json:"state,omitempty"`
}
UpdateProcessRequest represents the request to update a process
Click to show internal directories.
Click to hide internal directories.