Documentation
¶
Index ¶
- func BoolPtrOr(ptr *bool, fallback bool) bool
- func BuildProviderOrder(primary string, fallbacks []string, defaultOrder []string) []string
- func DedupeStrings(values []string) []string
- func EnvOr(existing, value string) string
- func FirstNonEmpty(values ...string) string
- func NormalizeBaseURL(value string) string
- func NormalizeElevatedLevel(raw string) (string, bool)
- func NormalizeEnum(raw string, aliases map[string]string) (string, bool)
- func NormalizeMimeType(mimeType string) string
- func SplitCSV(value string) []string
- func StripMarkup(text string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildProviderOrder ¶
BuildProviderOrder constructs a deduplicated provider order list. primary is placed first (unless empty or "auto"), followed by fallbacks. If the resulting list is empty, a clone of defaultOrder is returned.
func DedupeStrings ¶
DedupeStrings returns a deduplicated copy of values, preserving order. Empty strings and strings that are empty after trimming are skipped.
func FirstNonEmpty ¶
FirstNonEmpty returns the first non-empty string after trimming.
func NormalizeBaseURL ¶
NormalizeBaseURL trims whitespace and trailing slashes from a URL.
func NormalizeElevatedLevel ¶
NormalizeElevatedLevel normalizes a raw elevated-level string to one of the canonical values: "off", "full", "ask", or "on". Returns the normalized value and true if recognized, or ("", false) for unrecognized input.
func NormalizeEnum ¶
NormalizeEnum normalizes a raw string to a canonical enum value. It lowercases and trims the input, then looks it up in the aliases map. Returns the canonical value and true if found, or ("", false) if not.
func NormalizeMimeType ¶
NormalizeMimeType lowercases, trims whitespace, and strips parameters from a MIME type.
func StripMarkup ¶
StripMarkup removes common HTML/markdown formatting that models might wrap tokens in.
Types ¶
This section is empty.