refactored some stuff, added healthcheck support, fixed 'include file' reload not showing in log

This commit is contained in:
yusing
2024-10-12 13:56:38 +08:00
parent 64e30f59e8
commit d47b672aa5
41 changed files with 783 additions and 421 deletions

View File

@@ -13,7 +13,7 @@ type (
var pathPattern = regexp.MustCompile(`^(/[-\w./]*({\$\})?|((GET|POST|DELETE|PUT|HEAD|OPTION) /[-\w./]*({\$\})?))$`)
func NewPathPattern(s string) (PathPattern, E.NestedError) {
func ValidatePathPattern(s string) (PathPattern, E.NestedError) {
if len(s) == 0 {
return "", E.Invalid("path", "must not be empty")
}
@@ -29,7 +29,7 @@ func ValidatePathPatterns(s []string) (PathPatterns, E.NestedError) {
}
pp := make(PathPatterns, len(s))
for i, v := range s {
pattern, err := NewPathPattern(v)
pattern, err := ValidatePathPattern(v)
if err != nil {
return nil, err
}