Documentation ¶
Index ¶
- Constants
- Variables
- func New(toplr interface{}) *sendmail_t
- type IPlayer
- type Mail
- type MailBox
- func (self *MailBox) GetAttachment(id int32) (ec PB.RetType, a []*PB.MailRes)
- func (self *MailBox) GetMails() map[int32]*Mail
- func (self *MailBox) Init(plr IPlayer)
- func (self *MailBox) Read(id int32) (ec PB.RetType, affected *Mail)
- func (self *MailBox) Remove(id int32) PB.RetType
- func (self *MailBox) RemoveOnekey() (ids []int32)
- func (self *MailBox) SyncGMails()
- func (self *MailBox) TakeAttachment(id int32) (ec PB.RetType, a []*PB.MailRes, affected *Mail)
- func (self *MailBox) TakeAttachmentAll() (ec PB.RetType, a []*PB.MailRes, affected []*Mail)
- func (self *MailBox) ToMsg() (ret []*PB.Mail)
Constants ¶
View Source
const ( C_mail_max = 200 C_mail_days_attachment = 15 C_mail_days_unread = 7 C_mail_days_read = 2 )
View Source
const (
C_gmail_max = 300
)
Variables ¶
View Source
var (
GMailBox = &gmail_box_t{}
)
Functions ¶
Types ¶
type Mail ¶
type Mail struct { Id int32 `bson:"id"` // mail id Key int32 `bson:"key"` // mail key Sender string `bson:"sender"` // sender Title string `bson:"title,omitempty"` // mail title (id | string) Text string `bson:"text,omitempty"` // mail text (id | string) Dict map[string]string `bson:"dict,omitempty"` // dict Attachment []*PB.MailRes `bson:"a,omitempty"` // attachment Read bool `bson:"read"` // read flag Taken bool `bson:"taken"` // taken flag Ts int64 `bson:"ts"` // create timestamp ExpireTs int64 `bson:"ets"` // expire timestamp Cond string `bson:",omitempty"` // deliver condition for gmail }
Mail struct
Title, Text support both id and string formats id: "n:123456" string: "s:helloworld" if no 'prefix' is found, it'll be treated as a plane-string
Deliver condition format:
empty: no condition
cond|cond|... satisfy all 'cond'
any unrecognized 'cond' will block the delivery
cond: var op val
var: lv: player level cdate: player creation date ldate: player last login date
op: <, <=, >, >=, ==, !=
val: number string date: format -> 2017-1-1 3:4:5
type MailBox ¶
type MailBox struct {
// contains filtered or unexported fields
}
MailBox struct
seqid: number gmailid: number mails: { id: { contents } }
func NewMailBox ¶
func NewMailBox() *MailBox
func (*MailBox) GetAttachment ¶
func (*MailBox) RemoveOnekey ¶
func (*MailBox) SyncGMails ¶
func (self *MailBox) SyncGMails()
func (*MailBox) TakeAttachment ¶
func (*MailBox) TakeAttachmentAll ¶
Click to show internal directories.
Click to hide internal directories.