Documentation ¶
Index ¶
- Constants
- Variables
- func BoxUserList(uid int64) (int64, int64)
- func BoxUserMessageCountByClassName(uid int64, className string) (int64, int64)
- func BoxUserTotal(uid int64) (int64, int64)
- func CheckDb() bool
- func ClassGetIdByName(uid int64, name string) (int64, error)
- func CreateUser(u *User) (err error)
- func DomainCount() int64
- func DomainCreate(d *Domain) (err error)
- func DomainDeleteById(id int64) error
- func DomainDeleteByName(name string) error
- func DomainGetMainForDomain() (string, error)
- func DomainSetDefaultOnlyOne(id int64) error
- func DomainUpdateById(id int64, d Domain) error
- func DomainVaild(name string) bool
- func Init() error
- func LogAdd(ty, content string) error
- func LogClear() error
- func LogCount() int64
- func LogDeleteById(id int64) error
- func LoginByUserPassword(name string, password string) (bool, int64)
- func LoginWithCode(name string, code string) (bool, int64)
- func MailContentDelete(uid int64, mid int64) bool
- func MailContentDeleteDb(mid int64) bool
- func MailContentDeleteHardDisk(uid int64, mid int64) bool
- func MailContentDir(uid, mid int64) string
- func MailContentFilename(uid, mid int64) string
- func MailContentRead(uid, mid int64) (string, error)
- func MailContentReadDb(mid int64) (string, error)
- func MailContentReadHardDisk(uid int64, mid int64) (string, error)
- func MailContentWrite(uid int64, mid int64, content string) error
- func MailContentWriteDb(mid int64, content string) error
- func MailContentWriteHardDisk(uid int64, mid int64, content string) error
- func MailCount() int64
- func MailCountWithOpts(opts *MailSearchOptions) int64
- func MailDeleteById(id int64, status int64) bool
- func MailHardDeleteById(uid, mid int64) bool
- func MailHardDeleteByIds(ids []int64) bool
- func MailPosContentForPop(uid int64, pos int64) (string, int, error)
- func MailPush(uid int64, mtype int, mail_from string, mail_to string, content string, ...) (int64, error)
- func MailPushReceive(uid int64, mail_from string, mail_to string, content string) (int64, error)
- func MailPushSend(uid int64, mail_from string, mail_to string, content string, is_draft bool) (int64, error)
- func MailSearchByNameCond(opts *MailSearchOptions, dbm *gorm.DB) *gorm.DB
- func MailSeenById(id int64) bool
- func MailSeenByIds(ids []int64) bool
- func MailSetFlagsById(id int64, status int64) bool
- func MailSetIsCheckById(id int64, status int64) bool
- func MailSetJunkById(id int64, status int64) bool
- func MailSetJunkByIds(ids []int64, status int64) bool
- func MailSetStatusById(id int64, status int64) bool
- func MailSoftDeleteById(id int64) bool
- func MailSoftDeleteByIds(ids []int64) bool
- func MailStatInfo(uid int64, mtype int64) (int64, int64)
- func MailStatInfoForImap(uid int64, mtype int64) (int64, int64)
- func MailStatInfoForPop(uid int64) (int64, int64)
- func MailUnSeenById(id int64) bool
- func MailUnSeenByIds(ids []int64) bool
- func MailUpdate(id int64, uid int64, mtype int, mail_from string, mail_to string, ...) (int64, error)
- func Ping() error
- func TablePrefix(tn string) string
- func UpdateUser(u *User) error
- func UserCheckIsExist(name string) bool
- func UserGetAdminForName() (string, error)
- func UserUpdateCodeGetById(id int64, code string) error
- func UserUpdateCodeGetByName(name string, code string) bool
- func UserUpdateNickGetByName(name string, nick string) error
- func UserUpdateTokenGetById(id int64, token string) error
- func UserUpdateTokenGetByName(name string, token string) bool
- func UserUpdater(u *User) error
- func UsersCount() int64
- func UsersVaildCount() int64
- type Box
- type Class
- type DIRType
- type Domain
- type LogSearchOptions
- type Mail
- func BoxListByImap(uid int64, className string, start int64, end int64) ([]Mail, error)
- func BoxListByMid(uid int64, className string, mid int64) ([]Mail, error)
- func MailById(id int64) (Mail, error)
- func MailDeletedListAllForImap(uid int64) ([]Mail, error)
- func MailList(page, pageSize int, opts *MailSearchOptions) ([]Mail, error)
- func MailListAllForPop(uid int64) ([]Mail, error)
- func MailListForImap(uid int64) []Mail
- func MailListForPop(uid int64) []Mail
- func MailListForRspamd(limit int64) []Mail
- func MailListPosForPop(uid int64, pos int64) ([]Mail, error)
- func MailSearchByName(opts *MailSearchOptions) (user []Mail, _ int64, _ error)
- func MailSendListForStatus(status int64, limit int64) []Mail
- type MailContent
- type MailLog
- type MailSearchOptions
- type Queue
- type Statistic
- type User
- type UserSearchOptions
Constants ¶
View Source
const ( MailSearchOptionsTypeSend = iota MailSearchOptionsTypeInbox MailSearchOptionsTypeDraft MailSearchOptionsTypeDeleted MailSearchOptionsTypeFlags MailSearchOptionsTypeJunk MailSearchOptionsTypeUnread )
Variables ¶
Functions ¶
func BoxUserList ¶
func BoxUserMessageCountByClassName ¶
Get statistics under classification
func BoxUserTotal ¶
func DomainCount ¶
func DomainCount() int64
func DomainCreate ¶
func DomainDeleteById ¶
func DomainDeleteByName ¶
func DomainGetMainForDomain ¶
func DomainSetDefaultOnlyOne ¶
func DomainUpdateById ¶
func DomainVaild ¶
func LogDeleteById ¶
func MailContentDelete ¶
func MailContentDeleteDb ¶
func MailContentDir ¶
func MailContentFilename ¶
func MailContentRead ¶
func MailContentReadDb ¶
func MailContentWriteDb ¶
func MailCountWithOpts ¶
func MailCountWithOpts(opts *MailSearchOptions) int64
func MailDeleteById ¶
func MailHardDeleteById ¶
func MailPushReceive ¶
func MailPushSend ¶
func MailSearchByNameCond ¶
func MailSearchByNameCond(opts *MailSearchOptions, dbm *gorm.DB) *gorm.DB
func MailSeenById ¶
func MailSeenByIds ¶
func MailSetFlagsById ¶
func MailSetIsCheckById ¶
func MailSetJunkById ¶
func MailSetJunkByIds ¶
func MailSetStatusById ¶
func MailSoftDeleteById ¶
func MailSoftDeleteByIds ¶
func MailStatInfoForPop ¶
func MailUnSeenById ¶
func MailUnSeenByIds ¶
func MailUpdate ¶
func TablePrefix ¶
func UserCheckIsExist ¶
func UserGetAdminForName ¶
func UserUpdateCodeGetById ¶
func UserUpdateCodeGetByName ¶
func UserUpdateNickGetByName ¶
func UserUpdateTokenGetById ¶
func UserUpdater ¶
func UsersCount ¶
func UsersCount() int64
func UsersVaildCount ¶
func UsersVaildCount() int64
Types ¶
type Box ¶
type Box struct { Id int64 `gorm:"primaryKey"` Uid int64 `gorm:"comment:UID"` Mid int64 `gorm:"comment:MID"` Type int `gorm:"comment:TYPE|0:接收邮件;1:发送邮件"` Size int `gorm:"comment:邮件内容大小[byte]"` UpdateTime int64 `gorm:"autoCreateTime;comment:更新时间"` CreateTime int64 `gorm:"autoCreateTime;comment:创建时间"` }
type Class ¶
type Domain ¶
type Domain struct { Id int64 `gorm:"primaryKey"` Domain string `gorm:"unique;comment:顶级域名"` Mx bool `gorm:"comment:MX记录"` A bool `gorm:"comment:A记录"` Spf bool `gorm:"comment:Spf记录"` Dkim bool `gorm:"comment:Dkim记录"` Dmarc bool `gorm:"comment:DMARC记录"` IsDefault bool `gorm:"comment:是否默认"` Created time.Time `gorm:"autoCreateTime;comment:创建时间"` CreatedUnix int64 `gorm:"autoCreateTime;comment:创建时间"` Updated time.Time `gorm:"autoCreateTime;comment:更新时间"` UpdatedUnix int64 `gorm:"autoCreateTime;comment:更新时间"` }
func DomainGetById ¶
func DomainGetMain ¶
func DomainList ¶
func DomainVaildList ¶
type LogSearchOptions ¶
type Mail ¶
type Mail struct { Id int64 `gorm:"primaryKey"` Uid int64 `gorm:"index;comment:UserID"` Type int `gorm:"index;comment:0:Send;1:Received"` MailFrom string `gorm:"size:50;comment:Mail From"` MailFromInContent string `gorm:"text;comment:Mail From Name In Content"` MailTo string `gorm:"size:50;comment:Receive mail"` Subject string `gorm:"size:191;comment:Subject"` SubjectIndex string `gorm:"index;size:191;comment:Index Subject"` Size int `gorm:"size:10;comment:Message content size"` Status int `gorm:"size:2;comment:'0:准备发送;1:发送成功;2:发送失败;3:已接收'"` IsRead bool `gorm:"index;default:0;comment:是否已读"` IsDelete bool `gorm:"index;default:0;comment:是否删除"` IsFlags bool `gorm:"index;default:0;comment:是否星标"` IsJunk bool `gorm:"index;default:0;comment:是否无用"` IsDraft bool `gorm:"index;default:0;comment:是否草稿"` IsCheck bool `gorm:"default:0;comment:是否通过检查"` Created time.Time `gorm:"autoCreateTime;comment:创建时间"` CreatedUnix int64 `gorm:"autoCreateTime;comment:创建时间:UNIX"` Updated time.Time `gorm:"autoCreateTime;comment:更新时间"` UpdatedUnix int64 `gorm:"autoCreateTime;comment:更新时间:UNIX"` }
func BoxListByImap ¶
// Paging List of Imap Protocol
func MailListAllForPop ¶
func MailListForImap ¶
func MailListForPop ¶
func MailListForRspamd ¶
func MailSearchByName ¶
func MailSearchByName(opts *MailSearchOptions) (user []Mail, _ int64, _ error)
func MailSendListForStatus ¶
type MailContent ¶
type MailContent struct { Id int64 `gorm:"primaryKey"` Mid int64 `gorm:"uniqueIndex;comment:MID"` Content string `gorm:"comment:Content"` }
func (*MailContent) TableName ¶
func (*MailContent) TableName() string
type MailLog ¶
type MailLog struct { Id int64 `gorm:"primaryKey"` Type string `gorm:"index;comment:type"` Content string `gorm:"comment:content"` CreatedUnix int64 `gorm:"autoCreateTime;comment:创建时间"` UpdatedUnix int64 `gorm:"autoCreateTime;comment:更新时间"` }
func LogSearchByName ¶
func LogSearchByName(opts *LogSearchOptions) (user []MailLog, _ int64, _ error)
type MailSearchOptions ¶
type Queue ¶
type Queue struct { Id int64 `gorm:"primaryKey"` Uid int64 `gorm:"comment:用户ID"` Type int `gorm:"comment:0:发送;1:收到"` MailFrom string `gorm:"size:50;comment:邮件来源"` MailTo string `gorm:"size:50;comment:接收邮件"` Content string `gorm:"comment:邮件内容"` Size int `gorm:"size:50;comment:邮件内容大小"` Status int `gorm:"comment:0:准备发送;1:发送成功;2:发送失败;3:已接收"` UpdateTime int64 `gorm:"autoCreateTime;comment:更新时间"` CreateTime int64 `gorm:"autoCreateTime;comment:创建时间"` }
type Statistic ¶
func GetStatistic ¶
func GetStatistic() (stats Statistic)
type User ¶
type User struct { Id int64 `gorm:"primaryKey"` Name string `gorm:"index:uniqueIndex;unique;size:50;comment:登录账户"` Nick string `gorm:"index:uniqueIndex;unique;size:50;comment:昵称"` Password string `gorm:"size:32;comment:用户密码"` Salt string `gorm:"type:varchar(10)"` Code string `gorm:"size:50;comment:编码"` Status int `gorm:"comment:状态"` IsActive bool IsAdmin bool Created time.Time `gorm:"autoCreateTime;comment:创建时间"` CreatedUnix int64 `gorm:"autoCreateTime;comment:创建时间"` Updated time.Time `gorm:"autoCreateTime;comment:更新时间"` UpdatedUnix int64 `gorm:"autoCreateTime;comment:更新时间"` }
func UserGetAdmin ¶
func UserGetById ¶
func UserGetByName ¶
func UserSearchByName ¶
func UserSearchByName(opts *UserSearchOptions) (user []User, _ int64, _ error)
func (*User) ValidPassword ¶
Click to show internal directories.
Click to hide internal directories.