Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/internal/model/setting.go
1560 views
1
package model
2
3
const (
4
SINGLE = iota
5
SITE
6
STYLE
7
PREVIEW
8
GLOBAL
9
OFFLINE_DOWNLOAD
10
INDEX
11
SSO
12
LDAP
13
S3
14
FTP
15
TRAFFIC
16
)
17
18
const (
19
PUBLIC = iota
20
PRIVATE
21
READONLY
22
DEPRECATED
23
)
24
25
type SettingItem struct {
26
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
27
Value string `json:"value"` // value
28
PreDefault string `json:"-" gorm:"-:all"` // deprecated value
29
Help string `json:"help"` // help message
30
Type string `json:"type"` // string, number, bool, select
31
Options string `json:"options"` // values for select
32
Group int `json:"group"` // use to group setting in frontend
33
Flag int `json:"flag"` // 0 = public, 1 = private, 2 = readonly, 3 = deprecated, etc.
34
Index uint `json:"index"`
35
}
36
37
func (s SettingItem) IsDeprecated() bool {
38
return s.Flag == DEPRECATED
39
}
40
41