mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
chore: adds comment for exported function
This commit is contained in:
parent
4fb7ba454e
commit
651103bdda
@ -14,6 +14,12 @@ var validUidPattern = regexp.MustCompile(`^[a-zA-Z0-9\-\_]*$`).MatchString
|
||||
var ErrDashboardInvalidUid = errors.New("uid contains illegal characters")
|
||||
var ErrDashboardUidToLong = errors.New("uid to long. max 40 characters")
|
||||
|
||||
func init() {
|
||||
gen, _ := shortid.New(1, allowedChars, 1)
|
||||
shortid.SetDefault(gen)
|
||||
}
|
||||
|
||||
// VerifyUid verifies the size and content of the uid
|
||||
func VerifyUid(uid string) error {
|
||||
if len(uid) > 40 {
|
||||
return ErrDashboardUidToLong
|
||||
@ -26,11 +32,6 @@ func VerifyUid(uid string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
gen, _ := shortid.New(1, allowedChars, 1)
|
||||
shortid.SetDefault(gen)
|
||||
}
|
||||
|
||||
// GenerateShortUid generates a short unique identifier.
|
||||
func GenerateShortUid() string {
|
||||
return shortid.MustGenerate()
|
||||
|
Loading…
Reference in New Issue
Block a user