Documentation ¶
Index ¶
- Constants
- func All(to interface{}, limit, page int) error
- func CheckErrNotFound(err error) bool
- func CheckUser(name, pwd, group string) error
- func CountAll(data interface{}) int
- func Del(data interface{}) error
- func Find(fieldName string, value interface{}, to interface{}, ...) error
- func Get(bucket, key string, data interface{}) error
- func GetGroupNames() []string
- func One(fieldName string, value interface{}, to interface{}) error
- func Prefix(fieldName string, prefix string, to interface{}, limit, page int) error
- func Save(data interface{}) error
- func Set(bucket, key string, data interface{}) error
- func SetGroup(g *Group) error
- func SetUser(v *User) error
- func SettingGet(data interface{}) error
- func SettingSet(data interface{}) error
- func Start()
- func Stop() error
- func StructName(data interface{}) string
- func Update(data interface{}) error
- func UpdateField(data interface{}, fieldName string, value interface{}) error
- type Group
- type GroupLinkAcl
- type IpMap
- type SettingOther
- type SettingSmtp
- type User
- type ValData
Constants ¶
View Source
const ( Allow = "allow" Deny = "deny" )
View Source
const ( SettingBucket = "SettingBucket" Installed = "Installed" )
View Source
const PageSize = 10
Variables ¶
This section is empty.
Functions ¶
func CheckErrNotFound ¶
func GetGroupNames ¶
func GetGroupNames() []string
func SettingGet ¶
func SettingGet(data interface{}) error
func SettingSet ¶
func SettingSet(data interface{}) error
func StructName ¶
func StructName(data interface{}) string
func UpdateField ¶
Types ¶
type Group ¶
type Group struct { Id int `json:"id" storm:"id,increment"` Name string `json:"name" storm:"unique"` Note string `json:"note"` AllowLan bool `json:"allow_lan"` ClientDns []ValData `json:"client_dns"` RouteInclude []ValData `json:"route_include"` RouteExclude []ValData `json:"route_exclude"` LinkAcl []GroupLinkAcl `json:"link_acl"` Bandwidth int `json:"bandwidth"` // 带宽限制 Status int8 `json:"status"` // 1正常 CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type GroupLinkAcl ¶
type IpMap ¶
type IpMap struct { Id int `json:"id" storm:"id,increment"` IpAddr net.IP `json:"ip_addr" storm:"unique"` MacAddr string `json:"mac_addr" storm:"unique"` Username string `json:"username"` Keep bool `json:"keep"` // 保留 ip-mac 绑定 KeepTime time.Time `json:"keep_time"` Note string `json:"note"` // 备注 LastLogin time.Time `json:"last_login"` UpdatedAt time.Time `json:"updated_at"` }
type SettingOther ¶
type SettingSmtp ¶
type User ¶
type User struct { Id int `json:"id" storm:"id,increment"` Username string `json:"username" storm:"unique"` Nickname string `json:"nickname"` Email string `json:"email"` // Password string `json:"password"` PinCode string `json:"pin_code"` OtpSecret string `json:"otp_secret"` Groups []string `json:"groups"` Status int8 `json:"status"` // 1正常 SendEmail bool `json:"send_email"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.