Documentation
¶
Index ¶
- Constants
- type AppSecurity
- type AppSecuritySet
- type AppSetting
- type CR
- type DeleteRecordRequest
- type DnsRecord
- type DnsRecordResp
- type HttpRecord
- type HttpRecordResp
- type LoginRequest
- type LoginResponse
- type Pagination
- type Permission
- type PermissionActionSet
- type Resolve
- type Resolves
- type Role
- type TblDns
- type TblHttp
- type TblResolve
- type TblUser
- type UserInfo
- type UserListResp
- type UserRequest
Constants ¶
View Source
const ( CodeOK = 0 CodeBadPermission = 1 CodeBadData = 2 CodeNoAuth = 3 CodeNoPermission = 4 CodeServerInternal = 5 CodeNoData = 6 CodeExpire = 7 RoleSuper = 0 RoleAdmin = 1 RoleNormal = 2 RoleGuest = 3 GODNS_RFI_KEY = "GODNSLOG" GODNS_RFI_VALUE = "694ef536e5d0245f203a1bcf8cbf3294" // md5sum($GODNS_RFI_KEY) )
============================================================================== api models ==============================================================================
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppSecurity ¶
type AppSecuritySet ¶
type AppSecuritySet struct {
Password string `json:"password"`
}
type AppSetting ¶
type CR ¶
type CR struct {
Message string `json:"message"`
Code int `json:"code"`
Error error `json:"error,omitempty"`
Timestamp int64 `json:"timestemp"`
Result interface{} `json:"result,omitempty"`
}
commone response
type DeleteRecordRequest ¶
type DeleteRecordRequest struct {
Ids []int64 `json:"ids"`
}
type DnsRecordResp ¶
type DnsRecordResp struct {
Pagination
Data []DnsRecord `json:"data"`
}
type HttpRecord ¶
type HttpRecordResp ¶
type HttpRecordResp struct {
Pagination
Data []HttpRecord `json:"data"`
}
type LoginRequest ¶
type LoginResponse ¶
type Pagination ¶
type Permission ¶
type Permission struct {
RoleId int `json:"roleId"`
PermissionId string `json:"permissionId"`
PermissionName string `json:"permissionName"`
ActionEntitySet []PermissionActionSet `json:"ActionEntitySet"`
}
type PermissionActionSet ¶
type Resolves ¶ added in v0.6.1
type Resolves []TblResolve
func (Resolves) GetTypeConflict ¶ added in v0.6.1
CNAME,TXT,MX 同一个host只允许配置1个
func (Resolves) GetValueConflict ¶ added in v0.6.1
Value 不允许重复
type Role ¶
type Role struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Permissions []Permission `json:"permissions"`
}
type TblHttp ¶
type TblHttp struct {
Id int64 `xorm:"pk autoincr"`
Uid int64 `xorm:"notnull"` //TblUser.Id fk
Ip string `xorm:"varchar(16) notnull"`
Var string `xorm:"varchar(255) index"`
Path string `xorm:"text notnull"`
Method string `xorm:"varchar(16)"`
Data string `xorm:"mediumtext"`
Ctype string `xorm:"varchar(64)"`
Ua string `xorm:"text"`
Ctime time.Time `xorm:"datetime"`
Atime time.Time `xorm:"datetime created"`
}
type TblResolve ¶ added in v0.6.1
type TblResolve struct {
Id int64 `xorm:"pk autoincr"`
Host string `xorm:"index varchar(255) notnull"` //host record, eg. www
Type string `xorm:"varchar(16) notnull"` //record type, eg. CNAME/A/MX/TXT/SRV/NS.
Value string `xorm:"varchar(255) notnull"`
Ttl uint32
Ctime time.Time `xorm:"created"`
Utime time.Time `xorm:"updated"`
}
type TblUser ¶
type TblUser struct {
Id int64 `xorm:"pk autoincr"`
Name string `xorm:"varchar(64) notnull unique"`
Email string `xorm:"varchar(64) notnull unique"`
Role int `xorm:"tinyint notnull default 0"`
ShortId string `xorm:"varchar(32) notnull unique"`
Token string `xorm:"varchar(128) notnull unique"`
Pass string `xorm:"varchar(128) notnull"`
//settings
Lang string `xorm:"varchar(16) default('en-US') notnull"`
Callback string `xorm:"text"`
CallbackMessage string `xorm:"text"`
Rebind []string `xorm:"json"`
CleanInterval int64 `xorm:"default 3600"`
Atime time.Time `xorm:"datetime created"`
Utime time.Time `xorm:"datetime updated"`
}
tbl_user
type UserListResp ¶
type UserListResp struct {
Pagination
Data []UserInfo `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.