Documentation
¶
Index ¶
- func Register(reg *execution.ActionRegistry)
- type Backup
- type Copy
- type Link
- type Mkdir
- type Move
- type Provider
- func (p *Provider) Backup(path, backupSuffix string) (string, error)
- func (p *Provider) Copy(path string, mode os.FileMode, content []byte) (string, error)
- func (p *Provider) Link(source, path string) error
- func (p *Provider) Mkdir(path string, mode os.FileMode) error
- func (p *Provider) Move(gitMv func(src, dst string) error, source, path string) error
- func (p *Provider) Remove(path string, prune bool, pruneBoundary string) error
- func (p *Provider) Render(templateData map[string]any, source, path, project string, content []byte) ([]byte, error)
- func (p *Provider) Source(path string) ([]byte, error)
- func (p *Provider) Unlink(path string, prune bool, pruneBoundary string) error
- func (p *Provider) Write(content, path string, mode os.FileMode) error
- type Remove
- type Render
- type Source
- type Unlink
- type Write
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(reg *execution.ActionRegistry)
Register registers all file actions with the given registry.
Types ¶
type Backup ¶
type Backup struct{ Impl *Provider }
Backup moves the existing file at node's "path" slot to a timestamped backup. The backup path is stored in node.Annotations["backup_path"] after execution.
type Copy ¶
type Copy struct{ Impl *Provider }
Copy writes content to node's "path" slot (consumer: reads content, checksums).
type Link ¶
type Link struct{ Impl *Provider }
Link creates a symlink from node's "path" slot pointing to "source" slot.
type Mkdir ¶
type Mkdir struct{ Impl *Provider }
Mkdir creates a directory at node's "path" slot.
type Move ¶
type Move struct{ Impl *Provider }
Move moves a file from node's "source" slot to "path" slot.
type Provider ¶
type Provider struct{}
Provider provides file system operations. Each method receives all inputs as parameters — no execution context, no node access.
func (*Provider) Backup ¶
Backup moves the file at path to a timestamped backup location. Returns the backup path.
func (*Provider) Copy ¶
Copy writes content to path with the given mode. Returns the SHA256 checksum of the written content.
func (*Provider) Link ¶
Link creates a symlink at path pointing to source. Idempotent: if the symlink already points correctly, it's a no-op.
func (*Provider) Move ¶
Move moves a file from source to path. Uses gitMv if provided (preserves git history), falling back to os.Rename.
func (*Provider) Remove ¶
Remove deletes the file at path. If prune is true and pruneBoundary is set, empty parent directories are removed up to the boundary.
func (*Provider) Render ¶
func (p *Provider) Render(templateData map[string]any, source, path, project string, content []byte) ([]byte, error)
Render processes content as a Go text/template. Returns the rendered bytes.
type Remove ¶
type Remove struct{ Impl *Provider }
Remove deletes the file at node's "path" slot.
type Render ¶
type Render struct{ Impl *Provider }
Render processes content as a Go text/template (transformer: reads content, stores result).
type Source ¶
type Source struct{ Impl *Provider }
Source reads a file and stores its content for downstream nodes.
type Unlink ¶
type Unlink struct{ Impl *Provider }
Unlink removes a symlink at node's "path" slot.