-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
44 lines (37 loc) · 672 Bytes
/
config.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
package store
import "time"
type BasicConfig struct {
Addr string
UserName string
Password string
Database string
Table string
}
type TokenConfig struct {
BasicConfig
GcDisabled bool
GcInterval time.Duration
}
type ClientConfig struct {
BasicConfig
}
func DefaultConfig() BasicConfig {
return BasicConfig{
Addr: "localhost:3306",
UserName: "root",
Password: "root",
Database: "oauth2",
}
}
func DefaultTokenConfig() *TokenConfig {
return &TokenConfig{
BasicConfig: DefaultConfig(),
GcDisabled: false,
GcInterval: time.Minute * 30,
}
}
func DefaultClientConfig() *ClientConfig {
return &ClientConfig{
DefaultConfig(),
}
}