opname

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MPL-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package opname is the single source of truth for what a stack name and an operation (rule) name may contain. Names are persisted contract identifiers — they become DB keys, `stage = stack/scope` path components, trace directory names, and continuation `opDir` segments — so they are validated (rejected) at the write boundary rather than silently transformed. The filesystem sanitizers in the *store backends remain as belt-and-suspenders; this is the loud upstream gate.

Pure: no FS/DB/deps, so both the admin API and the opstack loader can import it without a cycle. Tenant-reservation policy (e.g. boot/* is _sys-owned) is NOT here — that stays with the admin layer that knows the acting tenant.

Index

Constants

View Source
const LikeEscapeChar = `\`

LikeEscapeChar is the ESCAPE character callers should declare when matching a name with SQL LIKE. It is not a legal name character, so it can never collide with real data.

Variables

View Source
var ErrName = errors.New("invalid name")

ErrName is the sentinel for any invalid name (wrapped with detail).

Functions

func EscapeLike added in v0.2.24

func EscapeLike(s string) string

EscapeLike escapes every SQL LIKE metacharacter in s so the result matches LITERALLY under `LIKE ? ESCAPE '\'`. Use it on any name (or user-supplied prefix) that is spliced into a LIKE pattern — see the '_' note on seg.

Callers that deliberately want '%' to stay a wildcard (the ops resolver's `boot/%` ingress fallthrough is the only one) must escape '_' alone instead; see processor.escapeLikeLiterals.

func Valid

func Valid(name string) error

Valid reports whether name is a usable operation/rule name.

func ValidStack

func ValidStack(name string) error

ValidStack reports whether name is a usable stack name. A stack name is one or more "/"-joined segments (e.g. "hello-world", "_sys/boot"); every segment obeys the same charset as an operation name, so there is no empty/'.'/'..'/'%'/leading-or-trailing-slash/double-slash form.

Types

This section is empty.

Jump to

Keyboard shortcuts

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