video.go 581 B

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