Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxBranchNameLength = 40 ReValidRef = regexp.MustCompile(`^\w+/?\w+$`) ReValidRepo = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\-]{1,61}[a-zA-Z0-9]$`) ReValidUser = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_-]{1,28}[a-zA-Z0-9]$`) ReValidPath = regexp.MustCompile(`^[^\x00/:*?"<>|]*/?([^/\s\x00:*?"<>|]+/)*[^/\s\x00:*?"<>|]+(?:\.[a-zA-Z0-9]+)?$`) // RepoNameBlackList forbid repo name, reserve for routes RepoNameBlackList = []string{"repository", "repositories", "wip", "wips", "object", "objects", "commit", "commits", "ref", "refs", "repo", "repos", "user", "users"} )
View Source
var ( ErrNameBlackList = errors.New("repository name is black list") ErrNameTooLong = errors.New("name too long") ErrBranchFormat = errors.New("branch format must be <name> or <name>/<name>") ErrInvalidBranchName = errors.New("invalid branch name: must start with a number or letter and can only contain numbers, letters, hyphens or underscores") ErrInvalidRepoName = errors.New("repository name must start with a number or letter, can only contain numbers, letters, or hyphens, and must be between 3 and 63 characters in length") ErrInvalidUsername = errors.New("invalid username: it must start and end with a letter or digit, can contain letters, digits, hyphens, and cannot start or end with a hyphen; the length must be between 3 and 30 characters") ErrInvalidObjectPath = errors.New("invalid object path: it must not contain null characters or NTFS forbidden characters") )
Functions ¶
func ValidateBranchName ¶
func ValidateObjectPath ¶
func ValidateRepoName ¶
func ValidateUsername ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.