Documentation ¶
Index ¶
- func IsAlphaNumeric(c rune) bool
- func IsDigit(c rune) bool
- func IsLetter(c rune) bool
- func IsQualifiedName(device string) bool
- func ParseDevice(device string) (string, string, string)
- func ParseQualifiedName(device string) (string, string, string, error)
- func ParseQualifier(kind string) (string, string)
- func QualifiedName(vendor, class, name string) string
- func ValidateClassName(class string) error
- func ValidateDeviceName(name string) error
- func ValidateVendorName(vendor string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlphaNumeric ¶
IsAlphaNumeric reports whether the rune is a letter or digit.
func IsQualifiedName ¶
IsQualifiedName tests if a device name is qualified.
func ParseDevice ¶
ParseDevice tries to split a device name into vendor, class, and name. If this fails, for instance in the case of unqualified device names, ParseDevice returns an empty vendor and class together with name set to the verbatim input.
func ParseQualifiedName ¶
ParseQualifiedName splits a qualified name into device vendor, class, and name. If the device fails to parse as a qualified name, or if any of the split components fail to pass syntax validation, vendor and class are returned as empty, together with the verbatim input as the name and an error describing the reason for failure.
func ParseQualifier ¶
ParseQualifier splits a device qualifier into vendor and class. The syntax for a device qualifier is
"<vendor>/<class>"
If parsing fails, an empty vendor and the class set to the verbatim input is returned.
func QualifiedName ¶
QualifiedName returns the qualified name for a device. The syntax for a qualified device names is
"<vendor>/<class>=<name>".
A valid vendor and class name may contain the following runes:
'A'-'Z', 'a'-'z', '0'-'9', '.', '-', '_'.
A valid device name may contain the following runes:
'A'-'Z', 'a'-'z', '0'-'9', '-', '_', '.', ':'
func ValidateClassName ¶
ValidateClassName checks the validity of class name. A class name may contain the following ASCII characters:
- upper- and lowercase letters ('A'-'Z', 'a'-'z')
- digits ('0'-'9')
- underscore, dash, and dot ('_', '-', and '.')
func ValidateDeviceName ¶
ValidateDeviceName checks the validity of a device name. A device name may contain the following ASCII characters:
- upper- and lowercase letters ('A'-'Z', 'a'-'z')
- digits ('0'-'9')
- underscore, dash, dot, colon ('_', '-', '.', ':')
func ValidateVendorName ¶
ValidateVendorName checks the validity of a vendor name. A vendor name may contain the following ASCII characters:
- upper- and lowercase letters ('A'-'Z', 'a'-'z')
- digits ('0'-'9')
- underscore, dash, and dot ('_', '-', and '.')
Types ¶
This section is empty.