scriptpath

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scriptpath reads a Code Mode script from a file relative to a project folder (script_path), with the same confinement for every caller: the watch code step, wick_run_code and the run_code workflow node.

Index

Constants

View Source
const MaxBytes = 256 << 10

MaxBytes caps a script_path file.

Variables

View Source
var ErrDenied = errors.New("script_path denied")

ErrDenied marks a script_path refused for where it leads (absolute, .., or a real path outside the folder). It cannot heal by itself, unlike a missing file; errors.Is reports it.

Functions

func Read

func Read(dir, rel string) (string, error)

Read loads script_path rel from dir, fresh on every call. The real path (symlinks resolved) must sit inside dir's real path; anything else is refused with ErrDenied.

func Valid

func Valid(p string) error

Valid is the shape check of a script_path; where the path really leads is checked again on every read (Read).

Types

This section is empty.

Jump to

Keyboard shortcuts

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