2019-04-22 02:59:20 +00:00

16 lines
581 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package v1
// 表示video表中的limit字段每一位代表的含义
// limit中0表示通过1表示禁止
const (
VideoLimitBitAll uint64 = iota
VideoLimitBitBullet // 表示弹幕不显示,发布失败
VideoLimitBitMax
)
// IsLimitSet 根据输入的limits值返回相应limitType是否被设置
// example: 例如需要判断该视频是否可以发布弹幕的时候,如果(sql_limit_value & (1<<VideoLimitBitBullet)) > 0 则该视频被禁止发布弹幕
func IsLimitSet(limits uint64, limitType uint64) bool {
return limits&(1<<limitType) > 0
}