file_insert

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package file_insert implements the file_insert action handler.

The file_insert action inserts text before or after an anchor pattern with support for: - Literal and regex-based anchor matching - Before/after insertion positioning - Single or multiple anchor matches - Atomic writes (temp file + rename) - Backup creation before modification - Idempotency (no change if already inserted)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct{}

Handler implements the Handler interface for file_insert actions.

func (*Handler) DryRun

func (h *Handler) DryRun(ctx actions.Context, step *config.Step) error

DryRun logs what would happen without making changes.

func (*Handler) Execute

func (h *Handler) Execute(ctx actions.Context, step *config.Step) (actions.Result, error)

Execute runs the file_insert action.

func (*Handler) Metadata

func (h *Handler) Metadata() actions.ActionMetadata

Metadata returns metadata about the file_insert action.

func (*Handler) Run

func (h *Handler) Run(ctx actions.Context, step *config.Step) (actions.Result, error)

Run is the Spec 16 unified entry point. Computes the would-be content in memory once; plan mode reports the prediction, execute mode commits the change.

func (*Handler) Validate

func (h *Handler) Validate(step *config.Step) error

Validate checks if the file_insert configuration is valid.

Jump to

Keyboard shortcuts

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