v0.5: (BREAKING) simplified config format, improved output formatting, fixed docker watcher

This commit is contained in:
yusing
2024-09-16 03:48:39 +08:00
parent 719693deb7
commit 5be8659a99
34 changed files with 165 additions and 343 deletions

View File

@@ -2,14 +2,13 @@ package fields
import (
E "github.com/yusing/go-proxy/error"
F "github.com/yusing/go-proxy/utils/functional"
)
type Path struct{ F.Stringable }
type Path string
func NewPath(s string) (Path, E.NestedError) {
if s == "" || s[0] == '/' {
return Path{F.NewStringable(s)}, E.Nil()
return Path(s), E.Nil()
}
return Path{}, E.Invalid("path", s).With("must be empty or start with '/'")
return "", E.Invalid("path", s).With("must be empty or start with '/'")
}