MCPcopy Index your code
hub / github.com/coder/coder / TemplateVersionNameValid

Function TemplateVersionNameValid

codersdk/name.go:63–72  ·  view source on GitHub ↗

TemplateVersionNameValid returns whether the input string is a valid template version name.

(str string)

Source from the content-addressed store, hash-verified

61
62// TemplateVersionNameValid returns whether the input string is a valid template version name.
63func TemplateVersionNameValid(str string) error {
64 if len(str) > 64 {
65 return xerrors.New("must be <= 64 characters")
66 }
67 matched := templateVersionName.MatchString(str)
68 if !matched {
69 return xerrors.New("must be alphanumeric with underscores and dots")
70 }
71 return nil
72}
73
74// DisplayNameValid returns whether the input string is a valid template display name.
75func DisplayNameValid(str string) error {

Callers 4

initFunction · 0.92
templatePushMethod · 0.92

Calls 1

NewMethod · 0.65