mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-24 10:01:04 +01:00
fixed serialization and middleware compose
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
E "github.com/yusing/go-proxy/internal/error"
|
||||
@@ -76,3 +77,11 @@ func BoolParser(value string) (any, E.NestedError) {
|
||||
return nil, E.Invalid("boolean value", value)
|
||||
}
|
||||
}
|
||||
|
||||
func IntParser(value string) (any, E.NestedError) {
|
||||
i, err := strconv.Atoi(value)
|
||||
if err != nil {
|
||||
return 0, E.Invalid("integer value", value)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user