Documentation
¶
Overview ¶
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : const.go # Created : 2019/1/14 11:03 # Last Modified : 2019/1/14 11:03 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : curd.go # Created : 2019/1/21 15:13 # Last Modified : 2019/1/21 15:13 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : getter.go # Created : 2019/1/11 17:48 # Last Modified : 2019/1/11 17:48 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : limit.go # Created : 2019/1/25 16:09 # Last Modified : 2019/1/25 16:09 # Describe : 限制短信发送频次 # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : list.go # Created : 2019/1/22 19:34 # Last Modified : 2019/1/22 19:34 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : local.go # Created : 2019/1/15 19:27 # Last Modified : 2019/1/15 19:27 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : lock.go # Created : 2019/1/18 17:35 # Last Modified : 2019/1/18 17:35 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : putter.go # Created : 2019/1/14 10:58 # Last Modified : 2019/1/14 10:58 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : transaction.go # Created : 2019/1/23 14:38 # Last Modified : 2019/1/23 14:38 # Describe : # # ====================================================
Index ¶
- func AddLocalTemplate(ctx context.Context, s string, v string) error
- func BaseDetail(ctx context.Context, k string) ([]byte, error)
- func BaseTemplate(ctx context.Context, k string) (string, error)
- func Detail(ctx context.Context, id string) ([]byte, error)
- func LLenMsg() (int64, error)
- func LPopMsg() ([]byte, error)
- func LastestDetail(ctx context.Context, k string) ([]byte, error)
- func LocalTemplate(ctx context.Context, s string) (string, error)
- func LockID5s(ctx context.Context, k string) error
- func LockId(ctx context.Context, k string) error
- func PutBaseCache(ctx context.Context, k string, v []byte) error
- func PutBaseTemplate(ctx context.Context, k string, v []byte) error
- func PutSendSuccess(ctx context.Context, k string) error
- func RPushMsg(ctx context.Context, b []byte) error
- func RateLimit(ctx context.Context, toUser string, sendTime time.Time) error
- func ReleaseLock(ctx context.Context, k string) error
- func RemoveLimit(ctx context.Context, toUser string, sendTime time.Time) error
- func SendResult(ctx context.Context, k string) (bool, error)
- func UnlockId(ctx context.Context, k string) error
- type Marshaler
- type Transaction
- func (t *Transaction) Close() error
- func (t *Transaction) Commit(ctx context.Context) error
- func (t *Transaction) CommitParam(ctx context.Context) ([]interface{}, error)
- func (t *Transaction) LPopMsg() ([]byte, error)
- func (t *Transaction) PutBaseCache(ctx context.Context, k string, v []byte) error
- func (t *Transaction) PutBaseTemplate(ctx context.Context, k string, v []byte) error
- func (t *Transaction) PutSendSuccess(ctx context.Context, k string) error
- func (t *Transaction) RPushMsg(ctx context.Context, b []byte) error
- func (t *Transaction) Rollback(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLocalTemplate ¶
AddLocalTemplate 将模板添加到本地缓存, 因为当前模板是不可变的所以,默认缓存1小时,如果以后变动频繁,可以适当降低缓存刷新时间。
func LocalTemplate ¶
LocalTemplate 从本地缓存中取出模板
func PutBaseCache ¶
PutBaseCache 底层缓存,跟数据库数据同步,不过期
func PutBaseTemplate ¶
PutBaseTemplate 将添加的模板存入缓存中
func PutSendSuccess ¶
PutSendResult 在bitmap中修改发送结果,一般只有发送成功的情况才需要设置
func RemoveLimit ¶
RemoveLimit 移除特定时间的限制
Types ¶
type Transaction ¶
func NewTransaction ¶
func NewTransaction() *Transaction
func (*Transaction) Close ¶
func (t *Transaction) Close() error
func (*Transaction) CommitParam ¶
func (t *Transaction) CommitParam(ctx context.Context) ([]interface{}, error)
CommitParam 待参数的提交
func (*Transaction) PutBaseCache ¶
PutBaseCache 底层缓存,跟数据库数据同步,不过期
func (*Transaction) PutBaseTemplate ¶
PutBaseTemplate 将添加的模板存入缓存中
func (*Transaction) PutSendSuccess ¶
func (t *Transaction) PutSendSuccess(ctx context.Context, k string) error
PutSendResult 修改发送结果,一般只有发送成功的情况才需要设置