Documentation
¶
Overview ¶
package features provides functionality for interacting with hatchet features.
Index ¶
- func IsValidCronExpression(expression string) bool
- type CELClient
- type CreateCronTrigger
- type CreateRatelimitOpts
- type CreateScheduledRunTrigger
- type CronsClient
- func (c *CronsClient) Create(ctx context.Context, workflowName string, cron CreateCronTrigger) (*rest.CronWorkflows, error)
- func (c *CronsClient) Delete(ctx context.Context, cronId string) error
- func (c *CronsClient) Get(ctx context.Context, cronId string) (*rest.CronWorkflows, error)
- func (c *CronsClient) List(ctx context.Context, opts rest.CronWorkflowListParams) (*rest.CronWorkflowsList, error)
- type FiltersClient
- func (c *FiltersClient) Create(ctx context.Context, opts rest.V1CreateFilterRequest) (*rest.V1Filter, error)
- func (c *FiltersClient) Delete(ctx context.Context, filterID string) (*rest.V1Filter, error)
- func (c *FiltersClient) Get(ctx context.Context, filterID string) (*rest.V1Filter, error)
- func (c *FiltersClient) List(ctx context.Context, opts *rest.V1FilterListParams) (*rest.V1FilterList, error)
- func (c *FiltersClient) Update(ctx context.Context, filterID string, opts rest.V1FilterUpdateJSONRequestBody) (*rest.V1Filter, error)
- type InvalidCronExpressionError
- type MetricsClient
- func (m *MetricsClient) GetQueueMetrics(ctx context.Context, opts *rest.TenantGetQueueMetricsParams) (*rest.TenantQueueMetrics, error)
- func (m *MetricsClient) GetTaskQueueMetrics(ctx context.Context) (*rest.TenantStepRunQueueMetrics, error)
- func (m *MetricsClient) GetWorkflowMetrics(ctx context.Context, workflowName string, opts *rest.WorkflowGetMetricsParams) (*rest.WorkflowMetrics, error)
- type RateLimitsClient
- type RunPriority
- type RunsClient
- func (r *RunsClient) Cancel(ctx context.Context, opts rest.V1CancelTaskRequest) (*rest.V1CancelledTasks, error)
- func (r *RunsClient) Get(ctx context.Context, runId string) (*rest.V1WorkflowRunDetails, error)
- func (r *RunsClient) GetStatus(ctx context.Context, runId string) (*rest.V1TaskStatus, error)
- func (r *RunsClient) List(ctx context.Context, opts rest.V1WorkflowRunListParams) (*rest.V1TaskSummaryList, error)
- func (r *RunsClient) Replay(ctx context.Context, opts rest.V1ReplayTaskRequest) (*rest.V1ReplayedTasks, error)
- func (r *RunsClient) SubscribeToStream(ctx context.Context, workflowRunId string) <-chan string
- type SchedulesClient
- func (s *SchedulesClient) Create(ctx context.Context, workflowName string, trigger CreateScheduledRunTrigger) (*rest.ScheduledWorkflows, error)
- func (s *SchedulesClient) Delete(ctx context.Context, scheduledRunId string) error
- func (s *SchedulesClient) Get(ctx context.Context, scheduledRunId string) (*rest.ScheduledWorkflows, error)
- func (s *SchedulesClient) List(ctx context.Context, opts rest.WorkflowScheduledListParams) (*rest.ScheduledWorkflowsList, error)
- type TenantClient
- type WorkersClient
- func (w *WorkersClient) Get(ctx context.Context, workerId string) (*rest.Worker, error)
- func (w *WorkersClient) List(ctx context.Context) (*rest.WorkerList, error)
- func (w *WorkersClient) Pause(ctx context.Context, workerId string) (*rest.Worker, error)
- func (w *WorkersClient) Unpause(ctx context.Context, workerId string) (*rest.Worker, error)
- type WorkflowsClient
- func (w *WorkflowsClient) Delete(ctx context.Context, workflowName string) (*rest.WorkflowDeleteResponse, error)
- func (w *WorkflowsClient) Get(ctx context.Context, workflowName string) (*rest.Workflow, error)
- func (w *WorkflowsClient) GetId(ctx context.Context, workflowName string) (uuid.UUID, error)
- func (w *WorkflowsClient) List(ctx context.Context, opts *rest.WorkflowListParams) (*rest.WorkflowList, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidCronExpression ¶ added in v0.72.2
IsValidCronExpression validates that a string is a valid cron expression.
Types ¶
type CELClient ¶
type CELClient struct {
// contains filtered or unexported fields
}
CELClient provides methods for evaluating CEL expressions
func NewCELClient ¶
func NewCELClient( api *rest.ClientWithResponses, tenantId string, ) *CELClient
NewCELClient creates a new CELClient
func (*CELClient) Debug ¶
func (c *CELClient) Debug(ctx context.Context, expression string, input map[string]any, additionalMetadata, filterPayload *map[string]any) (*rest.V1CELDebugResponse, error)
Debug evaluates a CEL expression with the provided input, filter payload, and optional metadata. Useful for testing and validating CEL expressions and debugging issues in production.
type CreateCronTrigger ¶
type CreateCronTrigger struct {
// Name is the unique identifier for the cron trigger.
Name string `json:"name"`
// Expression is the cron expression that defines the schedule.
Expression string `json:"expression"`
// (optional) Input is the input data for the workflow.
Input map[string]interface{} `json:"input,omitempty"`
// (optional) AdditionalMetadata is metadata to associate with the cron trigger.
AdditionalMetadata map[string]interface{} `json:"additionalMetadata,omitempty"`
// (optional) Priority is the priority of the run triggered by the cron.
Priority *RunPriority `json:"priority,omitempty"`
}
CreateCronTrigger contains the configuration for creating a cron trigger.
type CreateRatelimitOpts ¶
type CreateRatelimitOpts struct {
// key is the unique identifier for the rate limit
Key string
// limit is the maximum number of requests allowed within the duration
Limit int
// duration specifies the time period for the rate limit
Duration types.RateLimitDuration
}
CreateRatelimitOpts contains options for creating or updating a rate limit.
type CreateScheduledRunTrigger ¶
type CreateScheduledRunTrigger struct {
// TriggerAt specifies when the workflow should be triggered.
TriggerAt time.Time `json:"triggerAt"`
// Input is the optional input data for the workflow.
Input map[string]interface{} `json:"input,omitempty"`
// AdditionalMetadata is optional metadata to associate with the scheduled run.
AdditionalMetadata map[string]interface{} `json:"additionalMetadata,omitempty"`
Priority *RunPriority `json:"priority,omitempty"`
}
CreateScheduledRunTrigger contains the configuration for creating a scheduled run trigger.
type CronsClient ¶
type CronsClient struct {
// contains filtered or unexported fields
}
CronsClient provides methods for interacting with cron workflow triggers
func NewCronsClient ¶
func NewCronsClient( api *rest.ClientWithResponses, tenantId string, ) *CronsClient
NewCronsClient creates a new CronsClient
func (*CronsClient) Create ¶
func (c *CronsClient) Create(ctx context.Context, workflowName string, cron CreateCronTrigger) (*rest.CronWorkflows, error)
Create creates a new cron workflow trigger.
func (*CronsClient) Delete ¶
func (c *CronsClient) Delete(ctx context.Context, cronId string) error
Delete removes a cron workflow trigger.
func (*CronsClient) Get ¶
func (c *CronsClient) Get(ctx context.Context, cronId string) (*rest.CronWorkflows, error)
Get retrieves a specific cron workflow trigger by its ID.
func (*CronsClient) List ¶
func (c *CronsClient) List(ctx context.Context, opts rest.CronWorkflowListParams) (*rest.CronWorkflowsList, error)
List retrieves a collection of cron workflow triggers based on the provided parameters.
type FiltersClient ¶
type FiltersClient struct {
// contains filtered or unexported fields
}
FiltersClient provides methods for interacting with filters
func NewFiltersClient ¶
func NewFiltersClient( api *rest.ClientWithResponses, tenantID string, ) *FiltersClient
NewFiltersClient creates a new FiltersClient
func (*FiltersClient) Create ¶
func (c *FiltersClient) Create(ctx context.Context, opts rest.V1CreateFilterRequest) (*rest.V1Filter, error)
Create creates a new filter.
func (*FiltersClient) List ¶
func (c *FiltersClient) List(ctx context.Context, opts *rest.V1FilterListParams) (*rest.V1FilterList, error)
List lists filters for a given tenant.
type InvalidCronExpressionError ¶
type InvalidCronExpressionError struct {
Expression string
}
InvalidCronExpressionError represents an error when an invalid cron expression is provided.
func (*InvalidCronExpressionError) Error ¶
func (e *InvalidCronExpressionError) Error() string
type MetricsClient ¶
type MetricsClient struct {
// contains filtered or unexported fields
}
MetricsClient provides methods for retrieving metrics for workflows, tasks, and tenant queue
func NewMetricsClient ¶
func NewMetricsClient( api *rest.ClientWithResponses, tenantId string, ) *MetricsClient
NewMetricsClient creates a new MetricsClient
func (*MetricsClient) GetQueueMetrics ¶
func (m *MetricsClient) GetQueueMetrics(ctx context.Context, opts *rest.TenantGetQueueMetricsParams) (*rest.TenantQueueMetrics, error)
GetQueueMetrics retrieves tenant-wide queue metrics.
func (*MetricsClient) GetTaskQueueMetrics ¶
func (m *MetricsClient) GetTaskQueueMetrics(ctx context.Context) (*rest.TenantStepRunQueueMetrics, error)
GetTaskQueueMetrics retrieves tenant-wide step run queue metrics.
func (*MetricsClient) GetWorkflowMetrics ¶
func (m *MetricsClient) GetWorkflowMetrics(ctx context.Context, workflowName string, opts *rest.WorkflowGetMetricsParams) (*rest.WorkflowMetrics, error)
GetWorkflowMetrics retrieves metrics for a specific workflow.
type RateLimitsClient ¶
type RateLimitsClient struct {
// contains filtered or unexported fields
}
RateLimitsClient provides methods for interacting with rate limits
func NewRateLimitsClient ¶
func NewRateLimitsClient( api *rest.ClientWithResponses, tenantId string, admin v0Client.AdminClient, ) *RateLimitsClient
NewRateLimitsClient creates a new RateLimitsClient with the provided api client, tenant id, and admin client.
func (*RateLimitsClient) List ¶
func (c *RateLimitsClient) List(ctx context.Context, opts *rest.RateLimitListParams) (*rest.RateLimitList, error)
List retrieves rate limits based on the provided parameters (optional).
func (*RateLimitsClient) Upsert ¶
func (c *RateLimitsClient) Upsert(opts CreateRatelimitOpts) error
Upsert creates or updates a rate limit with the provided options.
type RunPriority ¶ added in v0.72.2
type RunPriority int32
RunPriority is the priority for a workflow run.
const ( // RunPriorityLow is the lowest priority for a workflow run. RunPriorityLow RunPriority = 1 // RunPriorityMedium is the medium priority for a workflow run. RunPriorityMedium RunPriority = 2 // RunPriorityHigh is the highest priority for a workflow run. RunPriorityHigh RunPriority = 3 )
type RunsClient ¶
type RunsClient struct {
// contains filtered or unexported fields
}
RunsClient provides methods for interacting with workflow runs
func NewRunsClient ¶
func NewRunsClient( api *rest.ClientWithResponses, tenantId string, v0Client client.Client, ) *RunsClient
NewRunsClient creates a new client for interacting with workflow runs.
func (*RunsClient) Cancel ¶
func (r *RunsClient) Cancel(ctx context.Context, opts rest.V1CancelTaskRequest) (*rest.V1CancelledTasks, error)
Cancel requests cancellation of a specific task within a workflow run.
func (*RunsClient) Get ¶
func (r *RunsClient) Get(ctx context.Context, runId string) (*rest.V1WorkflowRunDetails, error)
Get retrieves a workflow run by its ID.
func (*RunsClient) GetStatus ¶
func (r *RunsClient) GetStatus(ctx context.Context, runId string) (*rest.V1TaskStatus, error)
GetStatus retrieves the status of a workflow run by its ID.
func (*RunsClient) List ¶
func (r *RunsClient) List(ctx context.Context, opts rest.V1WorkflowRunListParams) (*rest.V1TaskSummaryList, error)
List retrieves a collection of workflow runs based on the provided parameters.
func (*RunsClient) Replay ¶
func (r *RunsClient) Replay(ctx context.Context, opts rest.V1ReplayTaskRequest) (*rest.V1ReplayedTasks, error)
Replay requests a task to be replayed within a workflow run.
func (*RunsClient) SubscribeToStream ¶
func (r *RunsClient) SubscribeToStream(ctx context.Context, workflowRunId string) <-chan string
SubscribeToStream subscribes to streaming events for a specific workflow run.
type SchedulesClient ¶
type SchedulesClient struct {
// contains filtered or unexported fields
}
SchedulesClient provides methods for interacting with workflow schedules
func NewSchedulesClient ¶
func NewSchedulesClient( api *rest.ClientWithResponses, tenantId string, namespace *string, ) *SchedulesClient
NewSchedulesClient creates a new SchedulesClient
func (*SchedulesClient) Create ¶
func (s *SchedulesClient) Create(ctx context.Context, workflowName string, trigger CreateScheduledRunTrigger) (*rest.ScheduledWorkflows, error)
Create creates a new scheduled workflow run.
func (*SchedulesClient) Delete ¶
func (s *SchedulesClient) Delete(ctx context.Context, scheduledRunId string) error
Delete removes a scheduled workflow run.
func (*SchedulesClient) Get ¶
func (s *SchedulesClient) Get(ctx context.Context, scheduledRunId string) (*rest.ScheduledWorkflows, error)
Get retrieves a specific scheduled workflow run by its ID.
func (*SchedulesClient) List ¶
func (s *SchedulesClient) List(ctx context.Context, opts rest.WorkflowScheduledListParams) (*rest.ScheduledWorkflowsList, error)
List retrieves a collection of scheduled workflow runs based on the provided parameters.
type TenantClient ¶
type TenantClient struct {
// contains filtered or unexported fields
}
TenantClient provides methods for interacting with your Tenant
func NewTenantCliet ¶
func NewTenantCliet( api *rest.ClientWithResponses, tenantId string, ) *TenantClient
NewTenantCliet creates a new TenantClient
type WorkersClient ¶
type WorkersClient struct {
// contains filtered or unexported fields
}
WorkersClient provides methods for interacting with workers
func NewWorkersClient ¶
func NewWorkersClient( api *rest.ClientWithResponses, tenantId string, ) *WorkersClient
NewWorkersClient creates a new WorkersClient
func (*WorkersClient) List ¶
func (w *WorkersClient) List(ctx context.Context) (*rest.WorkerList, error)
List retrieves all workers for the tenant.
type WorkflowsClient ¶
type WorkflowsClient struct {
// contains filtered or unexported fields
}
WorkflowsClient provides methods for interacting with workflows
func NewWorkflowsClient ¶
func NewWorkflowsClient( api *rest.ClientWithResponses, tenantId string, ) *WorkflowsClient
NewWorkflowsClient creates a new WorkflowsClient
func (*WorkflowsClient) Delete ¶
func (w *WorkflowsClient) Delete(ctx context.Context, workflowName string) (*rest.WorkflowDeleteResponse, error)
Delete removes a workflow by its ID or name.
func (*WorkflowsClient) List ¶
func (w *WorkflowsClient) List(ctx context.Context, opts *rest.WorkflowListParams) (*rest.WorkflowList, error)
List retrieves all workflows for the tenant with optional filtering parameters.