Documentation
¶
Index ¶
- func GetAllExecutors() []string
- func GetSchema(name string) (interface{}, error)
- func RegisterCapabilities(name string, caps Capability)
- func RegisterExecutor(name string, factory NewExecutorFunc)
- func RegisterSchema(name string, schema interface{})
- type APIClient
- type Capability
- type ExecutionContext
- type Executor
- type FlowStatusResponse
- type LocalLinuxDriver
- func (d *LocalLinuxDriver) Close() error
- func (d *LocalLinuxDriver) CreateDir(ctx context.Context, path string) error
- func (d *LocalLinuxDriver) CreateFile(ctx context.Context, path string) error
- func (d *LocalLinuxDriver) Dial(network, address string) (net.Conn, error)
- func (d *LocalLinuxDriver) Download(ctx context.Context, remotePath, localPath string) error
- func (d *LocalLinuxDriver) Exec(ctx context.Context, command string, workingDir string, env []string, ...) error
- func (d *LocalLinuxDriver) GetWorkingDirectory() string
- func (d *LocalLinuxDriver) IsRemote() bool
- func (d *LocalLinuxDriver) Join(parts ...string) string
- func (d *LocalLinuxDriver) ListFiles(ctx context.Context, dirPath string) ([]string, error)
- func (d *LocalLinuxDriver) Remove(ctx context.Context, path string) error
- func (d *LocalLinuxDriver) SetPermissions(ctx context.Context, path string, perms os.FileMode) error
- func (d *LocalLinuxDriver) TempDir() string
- func (d *LocalLinuxDriver) Upload(ctx context.Context, localPath, remotePath string) error
- type NewExecutorFunc
- type Node
- type NodeAuth
- type NodeDriver
- type RemoteLinuxDriver
- func (d *RemoteLinuxDriver) Close() error
- func (d *RemoteLinuxDriver) CreateDir(ctx context.Context, dirPath string) error
- func (d *RemoteLinuxDriver) CreateFile(ctx context.Context, filePath string) error
- func (d *RemoteLinuxDriver) Dial(network, address string) (net.Conn, error)
- func (d *RemoteLinuxDriver) Download(ctx context.Context, remotePath, localPath string) error
- func (d *RemoteLinuxDriver) Exec(ctx context.Context, command string, workingDir string, env []string, ...) error
- func (d *RemoteLinuxDriver) GetWorkingDirectory() string
- func (d *RemoteLinuxDriver) IsRemote() bool
- func (d *RemoteLinuxDriver) Join(parts ...string) string
- func (d *RemoteLinuxDriver) ListFiles(ctx context.Context, dirPath string) ([]string, error)
- func (d *RemoteLinuxDriver) Remove(ctx context.Context, filePath string) error
- func (d *RemoteLinuxDriver) SetPermissions(ctx context.Context, filePath string, perms os.FileMode) error
- func (d *RemoteLinuxDriver) TempDir() string
- func (d *RemoteLinuxDriver) Upload(ctx context.Context, localPath, remotePath string) error
- type TriggerFlowResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllExecutors ¶
func GetAllExecutors() []string
func RegisterCapabilities ¶ added in v0.7.0
func RegisterCapabilities(name string, caps Capability)
RegisterCapabilities registers the capabilities for a named executor.
func RegisterExecutor ¶
func RegisterExecutor(name string, factory NewExecutorFunc)
RegisterExecutor registers an executor new func under the given name.
func RegisterSchema ¶
func RegisterSchema(name string, schema interface{})
RegisterSchema should be called by executor modules to register their config schema
Types ¶
type APIClient ¶ added in v0.7.0
type APIClient struct {
// contains filtered or unexported fields
}
APIClient is an HTTP client for interacting with the server
func NewAPIClient ¶ added in v0.7.0
func (*APIClient) GetFlowStatus ¶ added in v0.7.0
func (c *APIClient) GetFlowStatus(ctx context.Context, namespace, execID string) (FlowStatusResponse, error)
GetFlowStatus retrieves the execution status of a flow.
func (*APIClient) TriggerFlow ¶ added in v0.7.0
func (c *APIClient) TriggerFlow(ctx context.Context, namespace, flowID string, params map[string]any) (TriggerFlowResponse, error)
TriggerFlow triggers a flow execution via the HTTP API. Params are sent as form-encoded data
type Capability ¶ added in v0.7.0
type Capability uint64
const ( RemoteExecution Capability = 1 << iota EnvironmentVariables FileTransfer StreamingOutput )
func GetCapabilities ¶ added in v0.7.0
func GetCapabilities(name string) (Capability, error)
GetCapabilities returns the capabilities of a named executor.
type ExecutionContext ¶
type ExecutionContext struct {
// WithConfig is the yaml config passed to the executor
WithConfig []byte
Inputs map[string]any
Stdout io.Writer
Stderr io.Writer
UserUUID string
NamespaceName string // human-readable namespace name for API calls
APIKey string // executor API key for authenticating with the server
APIBaseURL string // server base URL for API calls
}
type FlowStatusResponse ¶ added in v0.7.0
type FlowStatusResponse struct {
ID string `json:"id"`
FlowName string `json:"flow_name"`
FlowID string `json:"flow_id"`
Status string `json:"status"`
TriggerType string `json:"trigger_type"`
Input json.RawMessage `json:"input,omitempty"`
TriggeredBy string `json:"triggered_by"`
CurrentActionID string `json:"current_action_id"`
CreatedAt string `json:"created_at"`
StartedAt string `json:"started_at"`
CompletedAt string `json:"completed_at"`
ScheduledAt string `json:"scheduled_at,omitempty"`
}
type LocalLinuxDriver ¶
type LocalLinuxDriver struct {
// contains filtered or unexported fields
}
func (*LocalLinuxDriver) Close ¶
func (d *LocalLinuxDriver) Close() error
func (*LocalLinuxDriver) CreateDir ¶
func (d *LocalLinuxDriver) CreateDir(ctx context.Context, path string) error
func (*LocalLinuxDriver) CreateFile ¶
func (d *LocalLinuxDriver) CreateFile(ctx context.Context, path string) error
func (*LocalLinuxDriver) Dial ¶
func (d *LocalLinuxDriver) Dial(network, address string) (net.Conn, error)
func (*LocalLinuxDriver) Download ¶
func (d *LocalLinuxDriver) Download(ctx context.Context, remotePath, localPath string) error
func (*LocalLinuxDriver) GetWorkingDirectory ¶
func (d *LocalLinuxDriver) GetWorkingDirectory() string
func (*LocalLinuxDriver) IsRemote ¶
func (d *LocalLinuxDriver) IsRemote() bool
func (*LocalLinuxDriver) Join ¶
func (d *LocalLinuxDriver) Join(parts ...string) string
func (*LocalLinuxDriver) Remove ¶
func (d *LocalLinuxDriver) Remove(ctx context.Context, path string) error
func (*LocalLinuxDriver) SetPermissions ¶
func (*LocalLinuxDriver) TempDir ¶
func (d *LocalLinuxDriver) TempDir() string
type NewExecutorFunc ¶
type NewExecutorFunc func(name string, driver NodeDriver, execID string) (Executor, error)
NewExecutorFunc defines the signature for a function that can create an executor.
func GetNewExecutorFunc ¶
func GetNewExecutorFunc(name string) (NewExecutorFunc, error)
GetNewExecutorFunc is used to retrieve the NewExecutorFunc for an executor
type NodeDriver ¶
type NodeDriver interface {
Upload(ctx context.Context, localPath, remotePath string) error
Download(ctx context.Context, remotePath, localPath string) error
CreateDir(ctx context.Context, path string) error
CreateFile(ctx context.Context, path string) error
GetWorkingDirectory() string
Remove(ctx context.Context, path string) error
SetPermissions(ctx context.Context, path string, perms os.FileMode) error
Exec(ctx context.Context, command string, workingDir string, env []string, stdout, stderr io.Writer) error
Dial(network, address string) (net.Conn, error)
IsRemote() bool
TempDir() string
Join(parts ...string) string
// ListFiles should only return top level files and no directories
ListFiles(ctx context.Context, dirPath string) ([]string, error)
Close() error
}
func NewLocalLinux ¶
func NewLocalLinux() (NodeDriver, error)
func NewNodeDriver ¶
func NewNodeDriver(ctx context.Context, node Node) (NodeDriver, error)
func NewRemoteLinux ¶
func NewRemoteLinux(client remoteclient.RemoteClient) (NodeDriver, error)
type RemoteLinuxDriver ¶
type RemoteLinuxDriver struct {
// contains filtered or unexported fields
}
func (*RemoteLinuxDriver) Close ¶
func (d *RemoteLinuxDriver) Close() error
func (*RemoteLinuxDriver) CreateDir ¶
func (d *RemoteLinuxDriver) CreateDir(ctx context.Context, dirPath string) error
func (*RemoteLinuxDriver) CreateFile ¶
func (d *RemoteLinuxDriver) CreateFile(ctx context.Context, filePath string) error
func (*RemoteLinuxDriver) Dial ¶
func (d *RemoteLinuxDriver) Dial(network, address string) (net.Conn, error)
func (*RemoteLinuxDriver) Download ¶
func (d *RemoteLinuxDriver) Download(ctx context.Context, remotePath, localPath string) error
func (*RemoteLinuxDriver) GetWorkingDirectory ¶
func (d *RemoteLinuxDriver) GetWorkingDirectory() string
func (*RemoteLinuxDriver) IsRemote ¶
func (d *RemoteLinuxDriver) IsRemote() bool
func (*RemoteLinuxDriver) Join ¶
func (d *RemoteLinuxDriver) Join(parts ...string) string
func (*RemoteLinuxDriver) Remove ¶
func (d *RemoteLinuxDriver) Remove(ctx context.Context, filePath string) error
func (*RemoteLinuxDriver) SetPermissions ¶
func (*RemoteLinuxDriver) TempDir ¶
func (d *RemoteLinuxDriver) TempDir() string