Documentation
¶
Index ¶
- Constants
- Variables
- func ActivityRuntimeContext(requestCtx context.Context, appCtx context.Context) context.Context
- func AsStringMap(value any) (map[string]any, bool)
- func BoolOrDefault(value string, defaultValue bool) bool
- func CamelCaseToScreamingSnakeCase(s string) string
- func CamelCaseToSnakeCase(str string) string
- func CapitalizeFirstLetter(str string) string
- func Collect[T any](value any, mapper func(any) T) []T
- func Contains(slice []string, item string) bool
- func DerefString(p *string) string
- func ExtractCategoryMetadata(model any, categoryIDsInOrder []string) map[string]map[string]string
- func FirstNonEmpty(values ...string) string
- func GenerateRandomString(length int) string
- func GetStringOrDefault(m map[string]any, key, defaultValue string) string
- func IntOrDefault(value string, defaultValue int) int
- func IsAppLifecycleContext(ctx context.Context) bool
- func ParseKeywords(keywordsStr string) []string
- func ParseMetaTag(tag string) map[string]string
- func StringOrDefault(value, defaultValue string) string
- func StringPtrEqual(a, b *string) bool
- func StringPtrFromTrimmed(value string) *string
- func ToString(v any) string
- func TrimQuotes(s string) string
- func UniqueNonEmptyStrings(items []string) []string
- func UpdateIfChanged(target any, value any) bool
- func WithAppLifecycleContext(ctx context.Context) context.Context
Constants ¶
const ( HeaderAgentBootstrap = "X-Arcane-Agent-Bootstrap" HeaderAgentToken = "X-Arcane-Agent-Token" // #nosec G101: header name, not a credential HeaderApiKey = "X-Api-Key" // #nosec G101: header name, not a credential AgentPairingPrefix = "/api/environments/0/agent/pair" )
Auth header names and path prefixes shared between the Echo middleware (WebSocket/diagnostics) and the Huma auth bridge (REST). Keep these in one place so a change to a header name applies to every route type at once.
Variables ¶
var ( FilePerm os.FileMode = 0o644 DirPerm os.FileMode = 0o755 )
Functions ¶
func ActivityRuntimeContext ¶
ActivityRuntimeContext returns a context suitable for activity-backed work.
func AsStringMap ¶
AsStringMap attempts to convert any map-like interface to map[string]any.
func BoolOrDefault ¶
BoolOrDefault parses value as a bool, falling back to defaultValue when empty or unparseable.
func CamelCaseToSnakeCase ¶
func CapitalizeFirstLetter ¶
func DerefString ¶
func ExtractCategoryMetadata ¶
ExtractCategoryMetadata extracts category metadata from struct fields with catmeta tags Returns a map of category ID to category metadata in field order
func FirstNonEmpty ¶
FirstNonEmpty returns the first non-empty string in a list of values.
func GenerateRandomString ¶
func GetStringOrDefault ¶
func IntOrDefault ¶
IntOrDefault parses value as an int, falling back to defaultValue when empty or unparseable.
func IsAppLifecycleContext ¶
IsAppLifecycleContext reports whether ctx is tied to the application lifecycle.
func ParseKeywords ¶
ParseKeywords parses a comma-separated keywords string into a slice Returns an empty slice if the input is empty or contains only whitespace
func ParseMetaTag ¶
ParseMetaTag parses a struct tag meta value formatted as `k=v;other=val;...` Returns a map of key-value pairs extracted from the tag
func StringOrDefault ¶
StringOrDefault returns the trimmed value if non-empty, otherwise defaultValue.
func StringPtrEqual ¶
func StringPtrFromTrimmed ¶
func TrimQuotes ¶
func UniqueNonEmptyStrings ¶
UniqueNonEmptyStrings returns unique, non-empty, trimmed strings.
func UpdateIfChanged ¶
UpdateIfChanged updates the target value if it differs from the new value. It returns true if an update occurred. Supported types: *string, *bool, **string. For *string and *bool targets, if the value is a pointer of the same type, the update only happens if the value pointer is not nil.
Types ¶
This section is empty.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dbutil provides small generic helpers around GORM that consolidate repetitive single-row lookup and transaction boilerplate found across services.
|
Package dbutil provides small generic helpers around GORM that consolidate repetitive single-row lookup and transaction boilerplate found across services. |
|
Package iconcatalog resolves Arcane icon metadata into catalog URLs.
|
Package iconcatalog resolves Arcane icon metadata into catalog URLs. |