Skip to content

Commit

Permalink
Add deprecation comments to functions moved to parse
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Mar 21, 2023
1 parent c6a07da commit 8ea61a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/cdi/qualified-device.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ import (
// A valid device name may containe the following runes:
//
// 'A'-'Z', 'a'-'z', '0'-'9', '-', '_', '.', ':'
//
// Deprecated: use parse.QualifiedName instead.
func QualifiedName(vendor, class, name string) string {
return parse.QualifiedName(vendor, class, name)
}

// IsQualifiedName tests if a device name is qualified.
//
// Deprecated: use parse.IsQualifiedName instead
func IsQualifiedName(device string) bool {
return parse.IsQualifiedName(device)
}
Expand All @@ -50,6 +54,8 @@ func IsQualifiedName(device string) bool {
// 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.
//
// Deprecated: use parse.ParseQualifiedName instead
func ParseQualifiedName(device string) (string, string, string, error) {
return parse.ParseQualifiedName(device)
}
Expand All @@ -58,6 +64,8 @@ func ParseQualifiedName(device string) (string, string, string, error) {
// 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.
//
// Deprecated: use parse.ParseDevice instead
func ParseDevice(device string) (string, string, string) {
return parse.ParseDevice(device)
}
Expand All @@ -69,6 +77,8 @@ func ParseDevice(device string) (string, string, string) {
//
// If parsing fails, an empty vendor and the class set to the
// verbatim input is returned.
//
// Deprecated: use parse.ParseQualifier instead
func ParseQualifier(kind string) (string, string) {
return parse.ParseQualifier(kind)
}
Expand All @@ -78,6 +88,8 @@ func ParseQualifier(kind string) (string, string) {
// - upper- and lowercase letters ('A'-'Z', 'a'-'z')
// - digits ('0'-'9')
// - underscore, dash, and dot ('_', '-', and '.')
//
// Deprecated: use parse.ValidateVendorName instead
func ValidateVendorName(vendor string) error {
return parse.ValidateVendorName(vendor)
}
Expand All @@ -87,6 +99,8 @@ func ValidateVendorName(vendor string) error {
// - upper- and lowercase letters ('A'-'Z', 'a'-'z')
// - digits ('0'-'9')
// - underscore and dash ('_', '-')
//
// Deprecated: use parse.ValidateClassName instead
func ValidateClassName(class string) error {
return parse.ValidateClassName(class)
}
Expand All @@ -96,6 +110,8 @@ func ValidateClassName(class string) error {
// - upper- and lowercase letters ('A'-'Z', 'a'-'z')
// - digits ('0'-'9')
// - underscore, dash, dot, colon ('_', '-', '.', ':')
//
// Deprecated: use parse.ValidateDeviceName instead
func ValidateDeviceName(name string) error {
return parse.ValidateDeviceName(name)
}

0 comments on commit 8ea61a7

Please sign in to comment.