Documentation
¶
Index ¶
- Constants
- Variables
- type Archive
- type BatchParam
- type Ints
- func (is Ints) Bytes() []byte
- func (is *Ints) Evict(e int64) (ok bool)
- func (is Ints) Exist(i int64) (e bool)
- func (is Ints) MarshalTo(data []byte) (int, error)
- func (is *Ints) Scan(src interface{}) (err error)
- func (is Ints) Size() int
- func (is *Ints) Unmarshal(data []byte) error
- func (is Ints) Value() (driver.Value, error)
- type Message
- type ParamHandler
- type PushStatistic
- type Relation
- type RelationTagUser
- type Setting
Constants ¶
View Source
const ( // PushTypeUnknown 用户未上报推送设置 PushTypeUnknown = iota // PushTypeForbid 禁止推送稿件更新通知 PushTypeForbid // PushTypeSpecial 推送特别关注的upper的更新 PushTypeSpecial // PushTypeAttention 推送关注的upper的更新 PushTypeAttention )
View Source
const ( // RelationAttention 关注 RelationAttention = iota + 1 // RelationSpecial 特别关注 RelationSpecial )
View Source
const ( // StatisticsUnpush 命中分组但未推送 StatisticsUnpush = iota // StatisticsPush 命中分组且推送 StatisticsPush = 1 )
View Source
const ( // GroupDataTypeDefault 默认 GroupDataTypeDefault = "default" // GroupDataTypeHBase AI脚本提供的hbase数据 GroupDataTypeHBase = "hbase" // GroupDataTypeAbtest ab实验数据 GroupDataTypeAbtest = "ab_test" // GroupDataTypeAbComparison ab对照数据 GroupDataTypeAbComparison = "ab_comparison" )
View Source
const (
// AttrBitIsPGC pgc稿件的属性位
AttrBitIsPGC = 9
)
Variables ¶
View Source
var ( // BaseParamHandler fn BaseParamHandler = func(target *map[string]interface{}, args ...interface{}) {} // PushParamHandler fn PushParamHandler = func(target *map[string]interface{}, args ...interface{}) { var ( ok bool arc *Archive fans []int64 ) if target == nil || (*target)["archive"] == nil { log.Warn("PushParamHandler target(%+v)/target[archive] nil, args(%+v)", target, args) } else if arc, ok = (*target)["archive"].(*Archive); !ok || arc == nil { log.Warn("PushParamHandler target[archive]=%+v parse failed/nil, args(%+v), target(%+v)", (*target)["archive"], args, target) } if arc == nil { arc = &Archive{} } if len(args) != 1 || args[0] == nil { log.Warn("PushParamHandler args(%+v) less than 1 or nil, target(%+v) archive(%+v)", args, target, arc) } else if fans, ok = args[0].([]int64); !ok { log.Warn("PushParamHandler args(%+v) parse failed, target(%+v) archive(%+v)", args, target, arc) } b := md5.Sum([]byte(fmt.Sprintf("%d%s", arc.ID, xstr.JoinInts(fans)))) (*target)["uuid"] = fmt.Sprintf("%s%d", hex.EncodeToString(b[:]), time.Now().UnixNano()) } )
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct { ID int64 `json:"aid"` Mid int64 `json:"mid"` TypeID int16 `json:"typeid"` HumanRank int `json:"humanrank"` Duration int `json:"duration"` Title string `json:"title"` Cover string `json:"cover"` Content string `json:"content"` Tag string `json:"tag"` Attribute int32 `json:"attribute"` Copyright int8 `json:"copyright"` AreaLimit int8 `json:"arealimit"` State int `json:"state"` Author string `json:"author"` Access int `json:"access"` Forward int `json:"forward"` PubTime string `json:"pubtime"` Round int8 `json:"round"` CTime string `json:"ctime"` MTime string `json:"mtime"` }
Archive model
type BatchParam ¶
type BatchParam struct { Params map[string]interface{} Handler ParamHandler }
BatchParam str
func NewBatchParam ¶
func NewBatchParam(p map[string]interface{}, h ParamHandler) *BatchParam
NewBatchParam func
type Ints ¶
type Ints []int64
Ints be used to MySql\Protobuf varbinary converting.
func (Ints) MarshalTo ¶
MarshalTo marshal int64 slice to bytes,each int64 will occupy Fixed 8 bytes. if the argument data not supplied with the full size,it will return the actual written size
type Message ¶
type Message struct { Action string `json:"action"` Table string `json:"table"` New json.RawMessage `json:"new"` Old json.RawMessage `json:"old"` }
Message canal databus message.
type ParamHandler ¶
type ParamHandler func(target *map[string]interface{}, args ...interface{})
ParamHandler fn
type PushStatistic ¶
type PushStatistic struct { Aid int64 `json:"aid"` Group string `json:"group"` Type int `json:"type"` Mids string `json:"mids"` MidsCounter int `json:"mids_counter"` CTime time.Time `json:"ctime"` }
PushStatistic 推送统计数据对象
type Relation ¶
type Relation struct { Mid int64 `json:"mid,omitempty"` Fid int64 `json:"fid,omitempty"` Attribute uint32 `json:"attribute"` Status int `json:"status"` MTime string `json:"mtime"` CTime string `json:"ctime"` }
Relation user relation.
type RelationTagUser ¶
type RelationTagUser struct { Mid int64 `json:"mid,omitempty"` Fid int64 `json:"fid,omitempty"` Tag string `json:"tag"` MTime string `json:"mtime"` CTime string `json:"ctime"` }
RelationTagUser user relatino tag.
func (*RelationTagUser) HasTag ¶
func (r *RelationTagUser) HasTag(tag int64) bool
HasTag judge that whether has specified tag.
Click to show internal directories.
Click to hide internal directories.