Skip to content

Commit

Permalink
rename to ValidateUserNamespace
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Jul 29, 2024
1 parent bdd4e62 commit 4de783f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions share/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4de783f

Please sign in to comment.