bpop

package
v0.0.0-...-56464ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2020 License: GPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultMailCount int  = 20
	DirectionToLeft  bool = true
	DirectionToRight bool = false
)
View Source
const (
	MailDeleteSuccess int = iota
	MailNotFound
	MailDeleteFailed
)

Result

View Source
const (
	EC_Success int = iota
	EC_No_Mail
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdDelete

type CmdDelete struct {
	MailAddr string        `json:"mail_addr"`
	Owner    bmail.Address `json:"owner"`
	Eids     []uuid.UUID   `json:"eid"`
}

func (*CmdDelete) Hash

func (cd *CmdDelete) Hash() []byte

func (*CmdDelete) MsgType

func (cs *CmdDelete) MsgType() uint16

type CmdDeleteAck

type CmdDeleteAck struct {
	Result []CmdResult `json:"result"`
}

func (*CmdDeleteAck) GetBytes

func (cda *CmdDeleteAck) GetBytes() ([]byte, error)

func (*CmdDeleteAck) Hash

func (cda *CmdDeleteAck) Hash() []byte

func (*CmdDeleteAck) MsgType

func (cda *CmdDeleteAck) MsgType() uint16

type CmdDownload

type CmdDownload struct {
	MailAddr  string        `json:"mail_addr"`
	Owner     bmail.Address `json:"owner"`
	MailCnt   int           `json:"mail_cnt"`
	Direction bool          `json:"direction"` //false -> after TimePivot, true -> before TimePivot
	TimePivot int64         `json:"time_pivot"`
}

func (*CmdDownload) Hash

func (cd *CmdDownload) Hash() []byte

func (*CmdDownload) MsgType

func (cd *CmdDownload) MsgType() uint16

type CmdDownloadAck

type CmdDownloadAck struct {
	CryptEps []*bmp.BMailEnvelope
}

func (*CmdDownloadAck) GetBytes

func (cda *CmdDownloadAck) GetBytes() ([]byte, error)

func (*CmdDownloadAck) Hash

func (cda *CmdDownloadAck) Hash() []byte

func (*CmdDownloadAck) MsgType

func (cda *CmdDownloadAck) MsgType() uint16

type CmdResult

type CmdResult struct {
	Eid    uuid.UUID `json:"eid"`
	Result int       `json:"result"`
}

type CmdState

type CmdState struct {
	MailAddr  string        `json:"mail_addr"`
	Owner     bmail.Address `json:"owner"`
	BeforTime int64         `json:"before_time"`
}

func (*CmdState) Hash

func (cs *CmdState) Hash() []byte

func (*CmdState) MsgType

func (cs *CmdState) MsgType() uint16

type CmdStateAck

type CmdStateAck struct {
	SendMail    State `json:"send_mail_space"`
	ReceiptMail State `json:"receipt_mail"`
}

func (*CmdStateAck) GetBytes

func (csa *CmdStateAck) GetBytes() ([]byte, error)

func (*CmdStateAck) Hash

func (csa *CmdStateAck) Hash() []byte

func (*CmdStateAck) MsgType

func (csa *CmdStateAck) MsgType() uint16

type Command

type Command interface {
	Hash() []byte
	MsgType() uint16
}

type CommandAck

type CommandAck struct {
	NextSN    bmp.BMailSN    `json:"next_sn"`
	Hash      []byte         `json:"hash"`
	Sig       []byte         `json:"sig"`
	ErrorCode int            `json:"error_code"`
	CmdCxt    CommandContent `json:"cmd"`
}

func (*CommandAck) GetBytes

func (cs *CommandAck) GetBytes() ([]byte, error)

func (*CommandAck) MsgType

func (cs *CommandAck) MsgType() uint16

func (*CommandAck) VerifyHeader

func (cs *CommandAck) VerifyHeader(header *bmp.Header) bool

type CommandContent

type CommandContent interface {
	MsgType() uint16
	Hash() []byte
}

type CommandSyn

type CommandSyn struct {
	SN  bmp.BMailSN `json:"sn"`
	Sig []byte      `json:"sig"`
	Cmd Command     `json:"cmd"`
}

func (*CommandSyn) GetBytes

func (cs *CommandSyn) GetBytes() ([]byte, error)

func (*CommandSyn) MsgType

func (cs *CommandSyn) MsgType() uint16

func (*CommandSyn) VerifyHeader

func (cs *CommandSyn) VerifyHeader(header *bmp.Header) bool

type State

type State struct {
	TotalSpace int64 `json:"total_space"`
	UsedSize   int64 `json:"used_size"`
	TotalCount int   `json:"total_count"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL