Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsControlChar ¶
ContainsControlChar checks if a string contains any control characters (0x00-0x1F, 0x7F) Returns true if control characters are found (invalid for URLs)
func CreateVirtualPath ¶
CreateVirtualPath creates a properly encoded virtual path for media Example: "kodi-show", "123", "Some Hot/Cold" -> "kodi-show://123/Some%20Hot%2FCold" Both id and name are URL-encoded to ensure round-trip compatibility with ParseVirtualPathStr Note: Simple alphanumeric IDs like "123" or "monkey1" remain unchanged after encoding
func ExtractSchemeID ¶
ExtractSchemeID extracts the ID component from a scheme-based virtual path with proper URL decoding. Returns error if the path doesn't match the expected scheme. Example: ExtractSchemeID("steam://123/Game%20Name", "steam") -> "123", nil
func IsValidScheme ¶
IsValidScheme validates that a scheme follows RFC 3986 rules: - Must start with a letter - Can contain letters, digits, '+', '-', '.'
Types ¶
type URIComponents ¶
URIComponents holds parsed URI components
func ParseURIComponents ¶
func ParseURIComponents(uri string) URIComponents
ParseURIComponents manually parses a URI into its components Note: Does not extract fragments - they remain part of name/query for custom schemes Returns empty result if URI contains control characters or has invalid scheme
type VirtualPathResult ¶
VirtualPathResult holds parsed virtual path components
func ParseVirtualPathStr ¶
func ParseVirtualPathStr(virtualPath string) (VirtualPathResult, error)
ParseVirtualPathStr parses a virtual path and returns its components with string ID Virtual path format: scheme://id/name (e.g., "steam://123/Game%20Name") Maps to URL structure: scheme://host/path where host=id, path=name Uses manual parsing to handle malformed URLs gracefully