autofill

package
v2.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package autofill provides auto-fill value generation for AppSpecConfigItem auto-fill expressions. Supported types: defval, hexstr_32, hexstr_16, uuid.

Index

Constants

View Source
const (
	// DefVal uses the field's default value (returns empty, caller should use field.Default).
	DefVal = "defval"
	// HexStr32 generates a 32-character hex string (16 random bytes).
	HexStr32 = "hexstr_32"
	// HexStr16 generates a 16-character hex string (8 random bytes).
	HexStr16 = "hexstr_16"
	// UUID generates a UUID v4 string.
	UUID = "uuid"
)

Variables

This section is empty.

Functions

func Generate

func Generate(autoFill string) (string, error)

Generate produces a value based on the auto-fill type. For DefVal, returns empty string — the caller should fall back to the field's Default.

func GenerateIfEmpty

func GenerateIfEmpty(autoFill, currentValue string) (string, error)

GenerateIfEmpty generates an auto-fill value only if the current value is empty. Returns the current value if non-empty, otherwise generates a new value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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