Documentation ¶
Index ¶
Constants ¶
View Source
const ( KB = 1024 MsgSizeLimitBase = 10 * KB MsgSizeLimitMargin = 5 * KB MsgSizeLimit = MsgSizeLimitBase + MsgSizeLimitMargin // 15KB AvatarSizeLimit = 150 * KB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Island ¶
type Island struct { ID string // primary key Name string // 岛名 Email string // Email Avatar string // 头像 Link string // 小岛主页或岛主博客 Note string // 对该小岛的备注或评价 Hide bool // 小岛是否允许公开访问 Message SimpleMsg // 最新一条消息 }
func NewIsland ¶
func NewIsland(nl *Newsletter) Island
type Message ¶
func NewMessage ¶
type Newsletter ¶
type Newsletter struct { Name string `json:"name"` Email string `json:"email"` Avatar string `json:"avatar"` Link string `json:"link"` Messages []*SimpleMsg `json:"messages"` }
func (*Newsletter) Check ¶
func (nl *Newsletter) Check() (err error)
Check 检查 newsletter 是否含有必要的项目。 注意,应检查经 Tirm() 处理后的 newsletter, 即应 "先trim后check".
func (*Newsletter) Trim ¶
func (nl *Newsletter) Trim() *Newsletter
Trim 清除多余的空格,也清除 SimpleMsg.Body 为空的消息, 并且,如果 SimpleMsg.Time 比 time.Now() 晚超过 24 小时,这样的消息也应清除。
Click to show internal directories.
Click to hide internal directories.