diff --git a/share/namespace.go b/share/namespace.go index a8855b6..0772d88 100644 --- a/share/namespace.go +++ b/share/namespace.go @@ -12,7 +12,7 @@ type Namespace struct { // NewNamespace validates the provided version and id and returns a new namespace. // This should be used for user specified namespaces. func NewNamespace(version uint8, id []byte) (Namespace, error) { - if err := IsValidNamespace(version, id); err != nil { + if err := ValidateUserNamespace(version, id); err != nil { return Namespace{}, err } @@ -44,7 +44,7 @@ func NewNamespaceFromBytes(bytes []byte) (Namespace, error) { if len(bytes) != NamespaceSize { return Namespace{}, fmt.Errorf("invalid namespace length: %d. Must be %d bytes", len(bytes), NamespaceSize) } - if err := IsValidNamespace(bytes[VersionIndex], bytes[NamespaceVersionSize:]); err != nil { + if err := ValidateUserNamespace(bytes[VersionIndex], bytes[NamespaceVersionSize:]); err != nil { return Namespace{}, err } @@ -92,11 +92,11 @@ func (n Namespace) ID() []byte { return n.data[NamespaceVersionSize:] } -// IsValidNamespace returns an error if the provided version is not +// ValidateUserNamespace returns an error if the provided version is not // supported or the provided id does not meet the requirements // for the provided version. This should be user for validating // user specified namespaces -func IsValidNamespace(version uint8, id []byte) error { +func ValidateUserNamespace(version uint8, id []byte) error { err := validateVersionSupported(version) if err != nil { return err