contrib

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileActivity

func NewFileActivity() workflow.Activity

func NewShellActivity

func NewShellActivity() workflow.Activity

Types

type FileActivity

type FileActivity struct{}

FileActivity can be used to perform file operations

func (*FileActivity) Execute

func (a *FileActivity) Execute(ctx workflow.Context, params FileInput) (any, error)

func (*FileActivity) Name

func (a *FileActivity) Name() string

type FileInput

type FileInput struct {
	Operation   string `json:"operation"`   // read, write, append, delete, exists, mkdir, list
	Path        string `json:"path"`        // file or directory path
	Content     string `json:"content"`     // content to write (for write/append operations)
	Permissions string `json:"permissions"` // file permissions (e.g., "0644", "0755")
	CreateDirs  bool   `json:"create_dirs"` // create parent directories if they don't exist
}

FileInput defines the input parameters for the file activity

type ShellActivity

type ShellActivity struct{}

ShellActivity can be used to execute shell commands

func (*ShellActivity) Execute

func (a *ShellActivity) Execute(ctx workflow.Context, params ShellInput) (map[string]any, error)

func (*ShellActivity) Name

func (a *ShellActivity) Name() string

type ShellInput

type ShellInput struct {
	Command     string            `json:"command"`
	Args        []string          `json:"args"`
	WorkingDir  string            `json:"working_dir"`
	Environment map[string]string `json:"environment"`
	Timeout     time.Duration     `json:"timeout"` // 0 means no timeout
}

ShellInput defines the input parameters for the shell activity

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL