Documentation
¶
Index ¶
- Constants
- Variables
- func GetRequestID(methodName string, parts ...string) string
- func WithFixedStart() func(*RoundRobinSelector)
- type AuthorizedKey
- type CacheSettings
- type HTTPTriggerRequest
- type HTTPTriggerResponse
- type HTTPTriggerStatus
- type KeyType
- type OutboundHTTPRequest
- type OutboundHTTPResponse
- type RoundRobinSelector
- type WorkflowAuthMetadata
- type WorkflowSelector
Constants ¶
const ( MethodWorkflowPushAuthMetadata = "push_auth_metadata" MethodWorkflowPullAuthMetadata = "pull_auth_metadata" KeyTypeECDSA KeyType = "ecdsa" )
const ( // HTTPTriggerStatusAccepted indicates the trigger request was accepted. HTTPTriggerStatusAccepted HTTPTriggerStatus = "ACCEPTED" // MethodWorkflowExecute is the method name for executing workflows. MethodWorkflowExecute string = "workflows.execute" )
const (
MethodHTTPAction = "http_action"
)
Variables ¶
var ErrNoGateways = errors.New("no gateways available")
Functions ¶
func GetRequestID ¶ added in v0.8.0
GetRequestID generates a unique request ID for a method call. The method name is prepended to the ID, followed by any identifiers such as workflow ID, execution ID, or request ID. The method name is used by the gateway to identify the message type (e.g. "http_action", "push_auth_metadata", "pull_auth_metadata").
func WithFixedStart ¶
func WithFixedStart() func(*RoundRobinSelector)
WithFixedStart option will set the start point for the round robin selector.
Types ¶
type AuthorizedKey ¶ added in v0.8.0
type CacheSettings ¶
type CacheSettings struct {
ReadFromCache bool `json:"readFromCache,omitempty"` // If true, attempt to read a cached response for the request
StoreInCache bool `json:"storeInCache,omitempty"` // If true, store the response in cache for the given TTL
TTLMs int32 `json:"ttlMs,omitempty"` // Time-to-live for the cache entry in milliseconds. Only applicable if StoreInCache is true.
}
CacheSettings defines cache control options for outbound HTTP requests.
type HTTPTriggerRequest ¶
type HTTPTriggerRequest struct {
Workflow WorkflowSelector `json:"workflow"` // Selector for the workflow to execute.
Input json.RawMessage `json:"input"` // Input parameters for the workflow.
}
HTTPTriggerRequest represents a request to trigger a workflow via HTTP.
type HTTPTriggerResponse ¶
type HTTPTriggerResponse struct {
WorkflowID string `json:"workflow_id,omitempty"` // ID of the triggered workflow.
WorkflowExecutionID string `json:"workflow_execution_id,omitempty"` // ID of the workflow execution.
Status HTTPTriggerStatus `json:"status,omitempty"` // Status of the trigger request.
}
HTTPTriggerResponse represents the response to an HTTP trigger request.
type HTTPTriggerStatus ¶
type HTTPTriggerStatus string
HTTPTriggerStatus represents the status of an HTTP trigger request.
type OutboundHTTPRequest ¶
type OutboundHTTPRequest struct {
URL string `json:"url"` // URL to query, only http and https protocols are supported.
Method string `json:"method,omitempty"` // HTTP verb, defaults to GET.
Headers map[string]string `json:"headers,omitempty"` // HTTP headers, defaults to empty.
Body []byte `json:"body,omitempty"` // HTTP request body
TimeoutMs uint32 `json:"timeoutMs,omitempty"` // Timeout in milliseconds
CacheSettings CacheSettings `json:"cacheSettings,omitempty"` // Best-effort cache control for the request
// Maximum number of bytes to read from the response body. If the gateway max response size is smaller than this value, the gateway max response size will be used.
MaxResponseBytes uint32 `json:"maxBytes,omitempty"`
WorkflowID string `json:"workflowId"`
}
OutboundHTTPRequest represents an HTTP request to be sent from workflow node to the gateway.
func (OutboundHTTPRequest) Hash ¶
func (req OutboundHTTPRequest) Hash() string
type OutboundHTTPResponse ¶
type OutboundHTTPResponse struct {
ErrorMessage string `json:"errorMessage,omitempty"` // error message in case of execution errors. i.e. errors before or after attempting HTTP call to external client
StatusCode int `json:"statusCode,omitempty"` // HTTP status code
Headers map[string]string `json:"headers,omitempty"` // HTTP headers
Body []byte `json:"body,omitempty"` // HTTP response body
}
OutboundHTTPResponse represents the response from gateway to workflow node.
type RoundRobinSelector ¶
type RoundRobinSelector struct {
// contains filtered or unexported fields
}
func NewRoundRobinSelector ¶
func NewRoundRobinSelector(items []string, opts ...func(*RoundRobinSelector)) *RoundRobinSelector
NewRoundRobinSelector creates a selector that will select a string from a list using the round robin strategy. By default the index starts on a random start point in the list.
func (*RoundRobinSelector) NextGateway ¶
func (r *RoundRobinSelector) NextGateway() (string, error)
type WorkflowAuthMetadata ¶ added in v0.8.0
type WorkflowAuthMetadata struct {
WorkflowID string
AuthorizedKeys []AuthorizedKey
}
WorkflowAuthMetadata represents the metadata for workflow authorization This type is used for communication between the gateway handler in the gateway node and the gateway connector handler in the workflow node.
type WorkflowSelector ¶
type WorkflowSelector struct {
WorkflowOwner string `json:"workflowOwner,omitempty"` // Owner of the workflow.
WorkflowName string `json:"workflowName,omitempty"` // Name of the workflow.
WorkflowLabel string `json:"workflowLabel,omitempty"` // Optional label for the workflow.
WorkflowID string `json:"workflowID,omitempty"` // Unique ID of the workflow.
}
WorkflowSelector specifies how to identify a workflow.