utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoerceToType

func CoerceToType(v, typ string) interface{}

CoerceToType converts a string value to the appropriate Go type for JSON marshaling.

func ContainsStr

func ContainsStr(slice []string, s string) bool

ContainsStr returns true if slice contains s (exact match).

func CopyHeaders

func CopyHeaders(src map[string]string) map[string]string

CopyHeaders returns a shallow copy of a string map, safe for mutation.

func DefaultValueForType

func DefaultValueForType(t string) interface{}

DefaultValueForType returns a properly typed default value for a JSON schema type.

func MatchGlob

func MatchGlob(pattern, path string) bool

MatchGlob matches a path against a simple glob pattern. Supports trailing /* for prefix matching and leading * for suffix matching. Exact match is also supported.

func SanitizeID

func SanitizeID(s string) string

SanitizeID converts a string to a URL-safe kebab-case identifier.

Types

This section is empty.

Jump to

Keyboard shortcuts

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