Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAdminRole = Role{
Id: "admin",
Name: "admin",
Comment: "admin",
}
View Source
var DefaultAdminUserInfo = UserInfo{
Id: "admin",
LoginName: "admin",
LoginPassword: "3ef7b7e37a0fe84e4c5cdcd1934db0852f608c5c925751b9ef6cf872eb6eeaca",
Salt: "init",
UserName: "admin",
Email: "admin@cali.io",
}
View Source
var DefaultAdminUserInfoRole = UserInfoRoleLink{
Id: "admin",
UserInfo: "admin",
Role: "admin",
}
View Source
var (
DefaultCaliCategory = CaliCategory{Id: "default", Category: "默认", CreatedAt: time.Now().Unix(), UpdatedAt: time.Now().Unix()}
)
View Source
var DefaultSysConfig = make([]SysConfig, 0)
View Source
var DefaultUserInfo = UserInfo{
Id: "init",
LoginName: "anyone",
LoginPassword: "9fafdfffa1222faddec96c954ed67618aa78808842c8753d6d788e77258ada82",
Salt: "init",
UserName: "anyone",
Email: "anyone@cali.io",
}
View Source
var DefaultUserInfoRole = UserInfoRoleLink{
Id: "user",
UserInfo: "init",
Role: "user",
}
View Source
var DefaultUserRole = Role{
Id: "user",
Name: "user",
Comment: "user",
}
View Source
var DefaultWatcherRole = Role{
Id: "watcher",
Name: "watcher",
Comment: "watcher",
}
View Source
var RoleActions = make([]RoleAction, 0)
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
Result bool `json:"result"`
StatusCode int `json:"statusCode"`
Message string `json:"message"`
Info interface{} `json:"info"`
}
func NewErrorApi ¶
func NewErrorApi() Api
func NewErrorApiWithInfo ¶
func NewErrorApiWithInfo(info interface{}) Api
func NewOKApiWithInfo ¶
func NewOKApiWithInfo(info interface{}) Api
type CaliBook ¶ added in v0.1.0
type CaliBook struct {
Id string `json:"id" xorm:"pk 'id'"`
Title string `json:"title" xorm:"'title'"`
Author string `json:"author" xorm:"'author'"`
DownloadCount int `json:"download_count" xorm:"'download_count'"`
DoubanId string `json:"douban_id" xorm:"'douban_id'"`
DoubanJson string `json:"douban_json" xorm:"'douban_json'"`
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
type CaliBookCategory ¶ added in v0.1.0
type CaliBookCategory struct {
Id string `json:"id" xorm:"pk 'id'"`
CaliCategory string `json:"cali_category" xorm:"'cali_category'"`
CaliBook string `json:"cali_book" xorm:"'cali_book'"`
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
func (CaliBookCategory) TableName ¶ added in v0.1.0
func (CaliBookCategory) TableName() string
type CaliBookVo ¶ added in v0.1.0
type CaliBookVo struct {
CaliBook
Formats []CaliFormat `json:"formats"`
Categories []CaliCategory `json:"categories"`
}
type CaliCategory ¶ added in v0.1.0
type CaliCategory struct {
Id string `json:"id" xorm:"pk 'id'"`
Category string `json:"category" xorm:"'category'"`
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
func (CaliCategory) TableName ¶ added in v0.1.0
func (CaliCategory) TableName() string
type CaliFormat ¶ added in v0.1.0
type CaliFormat struct {
Id string `json:"id" xorm:"pk 'id'"`
CaliBook string `json:"cali_book" xorm:"'cali_book'"`
Format string `json:"format" xorm:"'format'"`
UncompressedSize int64 `json:"uncompressed_size" xorm:"'uncompressed_size'"`
Title string `json:"title" xorm:"'title'"`
Author string `json:"author" xorm:"'author'"`
FileName string `json:"file_name" xorm:"'file_name'"`
Tag string `json:"tag" xorm:"'tag'"`
DownloadCount int `json:"download_count" xorm:"'download_count'"`
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
func (CaliFormat) TableName ¶ added in v0.1.0
func (CaliFormat) TableName() string
type Role ¶ added in v0.0.2
type RoleAction ¶ added in v0.0.2
type RoleAction struct {
Id string `json:"id" xorm:"pk 'id'"`
Role string `json:"role" xorm:"varchar(32) 'role'"`
Controller string `json:"controller" xorm:"'controller'"`
Method string `json:"method" xorm:"'method'"`
Comments string `json:"comments" xorm:"'comments'"` //zhu shi
}
func (RoleAction) TableName ¶ added in v0.0.2
func (RoleAction) TableName() string
type SysConfig ¶ added in v0.0.3
type SysStatus ¶ added in v0.0.4
type UserConfig ¶ added in v0.1.0
type UserConfig struct {
Id string `json:"id" xorm:"pk 'id'"`
UserInfo string `json:"user_info" xorm:"'user_info'"`
MaxDownload int `json:"max_download" xorm:"'max_download' default 5"`
}
func NewUserConfig ¶ added in v0.1.0
func NewUserConfig(userInfoId string) UserConfig
func (UserConfig) TableName ¶ added in v0.1.0
func (UserConfig) TableName() string
type UserInfo ¶ added in v0.0.2
type UserInfo struct {
Id string `json:"id" xorm:"pk 'id'"`
LoginName string `json:"loginName" xorm:"varchar(64) notnull 'login_name'"`
LoginPassword string `json:"loginPassword" xorm:"varchar(128) notnull 'login_password'"`
Salt string `json:"salt" xorm:"varchar(128) notnull 'salt'"`
Email string `json:"email" xorm:"varchar(128) 'email'"`
UserName string `json:"userName" xorm:"varchar(64) notnull 'user_name'"`
Img string `json:"img" xorm:"varchar(256) 'img'"`
Valid int `json:"valid" xorm:"int default 0 'valid'"` //0 有效 1 无效 2 wait active
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
type UserInfoBookDownloadLink ¶ added in v0.0.4
type UserInfoBookDownloadLink struct {
Id string `json:"id" xorm:"pk 'id'"`
UserInfo string `json:"user_info" xorm:"'user_info'"`
CaliFormat string `json:"cali_format" xorm:"'cali_format'"`
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
func (UserInfoBookDownloadLink) TableName ¶ added in v0.0.4
func (UserInfoBookDownloadLink) TableName() string
type UserInfoBookUploadLink ¶ added in v0.0.4
type UserInfoBookUploadLink struct {
Id string `json:"id" xorm:"pk 'id'"`
UserInfo string `json:"user_info" xorm:"'user_info'"`
CaliFormat string `json:"cali_format" xorm:"'cali_format'"`
CreatedAt int64 `json:"created" xorm:"'created'"`
UpdatedAt int64 `json:"updated" xorm:"'updated'"`
}
func (UserInfoBookUploadLink) TableName ¶ added in v0.0.4
func (UserInfoBookUploadLink) TableName() string
type UserInfoRoleLink ¶ added in v0.0.2
type UserInfoRoleLink struct {
Id string `json:"id" xorm:"pk 'id'"`
UserInfo string `json:"user_info" xorm:"'user_info'"`
Role string `json:"role" xorm:"'role'"`
}
func (UserInfoRoleLink) TableName ¶ added in v0.0.2
func (UserInfoRoleLink) TableName() string
Click to show internal directories.
Click to hide internal directories.