diff --git a/goutils b/goutils index 01cd6d40..0b0fa3a0 160000 --- a/goutils +++ b/goutils @@ -1 +1 @@ -Subproject commit 01cd6d408cf66c6abb9bfbda54e8b6e8dd12bc1a +Subproject commit 0b0fa3a059eca0a9d2cc3451f7062d560a786896 diff --git a/internal/auth/utils.go b/internal/auth/utils.go index ae90e6df..df2d4c0e 100644 --- a/internal/auth/utils.go +++ b/internal/auth/utils.go @@ -8,7 +8,6 @@ import ( "time" "github.com/yusing/godoxy/internal/common" - strutils "github.com/yusing/goutils/strings" ) var ( @@ -70,12 +69,12 @@ func cookieDomain(r *http.Request) string { } } - parts := strutils.SplitRune(reqHost, '.') + parts := strings.Split(reqHost, ".") if len(parts) < 2 { return "" } parts[0] = "" - return strutils.JoinRune(parts, '.') + return strings.Join(parts, ".") } func SetTokenCookie(w http.ResponseWriter, r *http.Request, name, value string, ttl time.Duration) { diff --git a/internal/docker/container_helper.go b/internal/docker/container_helper.go index 171e55e7..f017792a 100644 --- a/internal/docker/container_helper.go +++ b/internal/docker/container_helper.go @@ -46,8 +46,8 @@ func (c containerHelper) getMounts() *ordered.Map[string, string] { } func (c containerHelper) parseImage() *types.ContainerImage { - colonSep := strutils.SplitRune(c.Image, ':') - slashSep := strutils.SplitRune(colonSep[0], '/') + colonSep := strings.Split(c.Image, ":") + slashSep := strings.Split(colonSep[0], "/") _, sha256, _ := strings.Cut(c.ImageID, ":") im := &types.ContainerImage{ SHA256: sha256, diff --git a/internal/docker/label.go b/internal/docker/label.go index d5800ca5..73df326c 100644 --- a/internal/docker/label.go +++ b/internal/docker/label.go @@ -9,7 +9,6 @@ import ( "github.com/goccy/go-yaml" "github.com/yusing/godoxy/internal/types" gperr "github.com/yusing/goutils/errs" - strutils "github.com/yusing/goutils/strings" ) var ErrInvalidLabel = errors.New("invalid label") @@ -31,7 +30,7 @@ func ParseLabels(labels map[string]string, aliases ...string) (types.LabelMap, e ExpandWildcard(labels, aliases...) for lbl, value := range labels { - parts := strutils.SplitRune(lbl, '.') + parts := strings.Split(lbl, ".") if parts[0] != NSProxy { continue } diff --git a/internal/health/monitor/monitor.go b/internal/health/monitor/monitor.go index 13213bb7..b16bab7c 100644 --- a/internal/health/monitor/monitor.go +++ b/internal/health/monitor/monitor.go @@ -6,6 +6,7 @@ import ( "fmt" "math/rand" "net/url" + "strings" "sync/atomic" "time" @@ -199,7 +200,7 @@ func (mon *monitor) Detail() string { // Name implements HealthMonitor. func (mon *monitor) Name() string { - parts := strutils.SplitRune(mon.service, '/') + parts := strings.Split(mon.service, "/") return parts[len(parts)-1] } diff --git a/internal/logging/accesslog/filter.go b/internal/logging/accesslog/filter.go index d77d3b84..e3c8fe14 100644 --- a/internal/logging/accesslog/filter.go +++ b/internal/logging/accesslog/filter.go @@ -8,7 +8,6 @@ import ( "strings" nettypes "github.com/yusing/godoxy/internal/net/types" - strutils "github.com/yusing/goutils/strings" ) type ( @@ -54,7 +53,7 @@ func (method HTTPMethod) Fulfill(req *http.Request, res *http.Response) bool { // Parse implements strutils.Parser. func (k *HTTPHeader) Parse(v string) error { - split := strutils.SplitRune(v, '=') + split := strings.Split(v, "=") switch len(split) { case 1: split = append(split, "") diff --git a/internal/logging/accesslog/retention.go b/internal/logging/accesslog/retention.go index 7033d61f..fdec969a 100644 --- a/internal/logging/accesslog/retention.go +++ b/internal/logging/accesslog/retention.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "strconv" + "strings" strutils "github.com/yusing/goutils/strings" ) @@ -32,7 +33,7 @@ var defaultChunkSize = 32 * kilobyte // // Parse implements strutils.Parser. func (r *Retention) Parse(v string) (err error) { - split := strutils.SplitSpace(v) + split := strings.Fields(v) if len(split) != 2 { return fmt.Errorf("%w: %s", ErrInvalidSyntax, v) } diff --git a/internal/logging/accesslog/status_code_range.go b/internal/logging/accesslog/status_code_range.go index 45341df5..e1e11c61 100644 --- a/internal/logging/accesslog/status_code_range.go +++ b/internal/logging/accesslog/status_code_range.go @@ -4,9 +4,9 @@ import ( "errors" "fmt" "strconv" + "strings" gperr "github.com/yusing/goutils/errs" - strutils "github.com/yusing/goutils/strings" ) type StatusCodeRange struct { @@ -22,7 +22,7 @@ func (r *StatusCodeRange) Includes(code int) bool { // Parse implements strutils.Parser. func (r *StatusCodeRange) Parse(v string) error { - split := strutils.SplitRune(v, '-') + split := strings.Split(v, "-") switch len(split) { case 1: start, err := strconv.Atoi(split[0]) diff --git a/internal/route/types/port.go b/internal/route/types/port.go index eb4382ed..a50a545f 100644 --- a/internal/route/types/port.go +++ b/internal/route/types/port.go @@ -3,9 +3,9 @@ package route import ( "errors" "strconv" + "strings" gperr "github.com/yusing/goutils/errs" - strutils "github.com/yusing/goutils/strings" ) type Port struct { @@ -20,7 +20,7 @@ var ( // Parse implements strutils.Parser. func (p *Port) Parse(v string) (err error) { - parts := strutils.SplitRune(v, ':') + parts := strings.Split(v, ":") switch len(parts) { case 1: p.Listening = 0