Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateFlow(ctx context.Context, req CreateFlowRequest) (*CreateFlowResponse, error)
- func (c *Client) CreateScheduledJob(ctx context.Context, req CreateScheduledJobRequest) (*CreateScheduledJobResponse, error)
- func (c *Client) GetFlow(ctx context.Context, path string) (*api.Flow, error)
- func (c *Client) UpdateFlow(ctx context.Context, path string, req UpdateFlowRequest) error
- type CreateFlowRequest
- type CreateFlowResponse
- type CreateScheduledJobRequest
- type CreateScheduledJobResponse
- type Flow
- type ScheduledJob
- type UpdateFlowRequest
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWindmillDisabled is returned when Windmill integration is disabled ErrWindmillDisabled = errors.New("windmill integration is disabled") // ErrMissingToken is returned when no API token is configured ErrMissingToken = errors.New("windmill API token is required") // ErrMissingWorkspace is returned when no workspace is configured ErrMissingWorkspace = errors.New("windmill workspace is required") // ErrInvalidFlowPath is returned when the flow path is invalid ErrInvalidFlowPath = errors.New("invalid flow path") // ErrFlowNotFound is returned when a flow is not found ErrFlowNotFound = errors.New("flow not found") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a simple SDK for creating and managing Windmill flows
func NewWindmill ¶
NewWindmill creates a new Windmill client based on the provided configuration
func (*Client) CreateFlow ¶
func (c *Client) CreateFlow(ctx context.Context, req CreateFlowRequest) (*CreateFlowResponse, error)
CreateFlow creates a new flow in Windmill and returns the flow path It wraps raw code into proper Windmill flow structure
func (*Client) CreateScheduledJob ¶
func (c *Client) CreateScheduledJob(ctx context.Context, req CreateScheduledJobRequest) (*CreateScheduledJobResponse, error)
CreateScheduledJob creates a new scheduled job in Windmill
func (*Client) UpdateFlow ¶
UpdateFlow updates an existing flow in Windmill
type CreateFlowRequest ¶
type CreateFlowRequest struct {
Path string `json:"path"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Value []any `json:"value"`
Schema *map[string]any `json:"schema,omitempty"`
Language enums.JobPlatformType `json:"language"`
}
CreateFlowRequest represents the request structure for creating a new flow
type CreateFlowResponse ¶
type CreateFlowResponse struct {
Path string `json:"path"`
}
CreateFlowResponse represents the response after creating a flow
type CreateScheduledJobRequest ¶
type CreateScheduledJobRequest struct {
Path string `json:"path"`
Schedule string `json:"schedule"`
FlowPath string `json:"script_path"`
Args any `json:"args,omitempty"`
Summary string `json:"summary,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
CreateScheduledJobRequest represents the request structure for creating a scheduled job
type CreateScheduledJobResponse ¶
type CreateScheduledJobResponse struct {
Path string `json:"path"`
}
CreateScheduledJobResponse represents the response after creating a scheduled job
type Flow ¶
type Flow struct {
Path string `json:"path"`
Summary string `json:"summary,omitempty"`
Value any `json:"value"`
Schema any `json:"schema,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"edited_at"`
}
Flow represents a complete flow definition
type ScheduledJob ¶
type ScheduledJob struct {
Path string `json:"path"`
Schedule string `json:"schedule"`
FlowPath string `json:"script_path"`
Args any `json:"args,omitempty"`
Summary string `json:"summary,omitempty"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"edited_at"`
}
ScheduledJob represents a scheduled job in Windmill
type UpdateFlowRequest ¶
type UpdateFlowRequest struct {
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Value []any `json:"value"`
Schema *map[string]interface{} `json:"schema,omitempty"`
Language enums.JobPlatformType `json:"language"`
}
UpdateFlowRequest represents the request structure for updating an existing flow