aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/temp.sql0
-rw-r--r--securecookie.go16
2 files changed, 16 insertions, 0 deletions
diff --git a/.vscode/temp.sql b/.vscode/temp.sql
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.vscode/temp.sql
diff --git a/securecookie.go b/securecookie.go
index c386907..912d64c 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -601,6 +601,22 @@ func DecodeMulti(name string, value string, dst interface{}, codecs ...Codec) er
return errors
}
+func DecodeMultiWithMaxAge(name string, value string, dst interface{}, maxAge int, codecs ...Codec) error {
+ if len(codecs) == 0 {
+ return errNoCodecs
+ }
+
+ var errors MultiError
+ for _, codec := range codecs {
+ err := codec.Decode(name, value, dst, maxAge)
+ if err == nil {
+ return nil
+ }
+ errors = append(errors, err)
+ }
+ return errors
+}
+
// MultiError groups multiple errors.
type MultiError []error