feat(cloud-agent): 云端 Agent - 完善运行时与资源持久化
This commit is contained in:
1 parent
48e6a705ef
commit
993580a7bd
40 files changed
+1739
-440
No files matched your search
@@ -10,11 +10,22 @@ import (
|
||||
|
||||
var projectUnitHTMLTagPattern = regexp.MustCompile(`<[^>]+>`)
|
||||
|
||||
const ProjectUnitTitleMaxRunes = 240
|
||||
|
||||
func ProjectUnitWordCount(sourceText string) int {
|
||||
plainText := projectUnitHTMLTagPattern.ReplaceAllString(sourceText, "")
|
||||
return utf8.RuneCountInString(strings.TrimSpace(html.UnescapeString(plainText)))
|
||||
}
|
||||
|
||||
func NormalizeProjectUnitTitle(value string) string {
|
||||
return strings.TrimSpace(value)
|
||||
}
|
||||
|
||||
func ValidProjectUnitTitle(value string) bool {
|
||||
title := NormalizeProjectUnitTitle(value)
|
||||
return title != "" && utf8.RuneCountInString(title) <= ProjectUnitTitleMaxRunes
|
||||
}
|
||||
|
||||
const AssetIDMaxLength = 80
|
||||
|
||||
type Resource struct {
|
||||
|
||||
Reference in new issue
Block a user