-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(state): Improve errors for validation failures
- Loading branch information
1 parent
bc53bd0
commit 99bde72
Showing
5 changed files
with
145 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package state | ||
|
||
import "windshift/service/internal/events" | ||
|
||
// IsValidStoreName checks if the store name is valid. | ||
func IsValidStoreName(name string) bool { | ||
return events.IsValidStreamName(name) | ||
} | ||
|
||
// IsValidKey checks if the key name is valid. The NATS documentation says | ||
// that keys follow the same rules as subjects so we delegate to events.IsValidSubject. | ||
func IsValidKey(name string) bool { | ||
return events.IsValidSubject(name, false) | ||
} |
Oops, something went wrong.