forked from alexedwards/scs
/
options.go
63 lines (51 loc) · 996 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package scs
import (
"time"
)
// Deprecated: Please use the Manager.Name() method to change the name of the
// session cookie.
var CookieName = "session"
type options struct {
domain string
httpOnly bool
idleTimeout time.Duration
lifetime time.Duration
name string
path string
persist bool
secure bool
}
type Options interface {
Domain() string
HttpOnly() bool
IdleTimeout() time.Duration
Lifetime() time.Duration
Name() string
Path() string
Persist() bool
Secure() bool
}
func (o *options) Domain() string {
return o.domain
}
func (o *options) HttpOnly() bool {
return o.httpOnly
}
func (o *options) IdleTimeout() time.Duration {
return o.idleTimeout
}
func (o *options) Lifetime() time.Duration {
return o.lifetime
}
func (o *options) Name() string {
return o.name
}
func (o *options) Path() string {
return o.path
}
func (o *options) Persist() bool {
return o.persist
}
func (o *options) Secure() bool {
return o.secure
}