Documentation ¶
Index ¶
- Constants
- func InitMySQL(dsn string) error
- func InitSQLite(file string) error
- type AsyncTask
- type AsyncTaskDAL
- type DDInfo
- type DDInfoDAL
- func (dal DDInfoDAL) BatchCreate(ctx *swe.Context, dd []DDInfo) error
- func (dal *DDInfoDAL) BatchGet(ctx *swe.Context, uids []int64) (map[int64]*DDInfo, error)
- func (dal *DDInfoDAL) GenerateAccessCode(ts, eventID, uid int64) string
- func (dal *DDInfoDAL) Get(ctx *swe.Context, uid int64) (*DDInfo, error)
- func (dal *DDInfoDAL) GetByAccessCode(ctx *swe.Context, code string) (*DDInfo, error)
- func (dal *DDInfoDAL) GetPublicKeys(ctx *swe.Context, uids []int64) (PublicKeyMap, error)
- func (dal *DDInfoDAL) SetKeyPair(ctx *swe.Context, info *DDInfo) error
- type DMDetail
- type DMTask
- type DMTaskStat
- type DirectMsgDAL
- func (dal DirectMsgDAL) BatchCreateDetails(ctx *swe.Context, details []DMDetail) error
- func (dal DirectMsgDAL) Get(ctx *swe.Context, id int64) (*DMTask, error)
- func (dal DirectMsgDAL) GetByRoomID(ctx *swe.Context, id, roomID int64) (*DMTask, error)
- func (dal DirectMsgDAL) LoadUnsentDetails(ctx *swe.Context, id int64, limit int) ([]DMDetail, error)
- func (dal DirectMsgDAL) Page(ctx *swe.Context, roomID int64, offset, limit int) (int, []DMTask, error)
- func (dal DirectMsgDAL) Put(ctx *swe.Context, task *DMTask) error
- func (dal DirectMsgDAL) Stats(ctx *swe.Context, id int64) (DMTaskStat, error)
- func (dal DirectMsgDAL) UpdateDetailStatus(ctx *swe.Context, id, uid int64, status int, reason string) error
- func (dal DirectMsgDAL) UpdateStatus(ctx *swe.Context, id int64, status int) error
- type GiftDAL
- func (dal GiftDAL) Infos(ctx *swe.Context) (ret []GiftInfo, err error)
- func (dal GiftDAL) Insert(ctx *swe.Context, gift *GiftRecord) error
- func (dal GiftDAL) Page(ctx *swe.Context, roomID, tsBegin, tsEnd int64, offset, limit int, uid int64, ...) (int, []GiftRecord, error)
- func (dal GiftDAL) Range(ctx *swe.Context, roomID, tsBegin, tsEnd int64) ([]*GiftRecord, error)
- func (dal GiftDAL) UpdateGiftInfo(ctx *swe.Context, id int64, name string, price int64) error
- type GiftInfo
- type GiftRecord
- type MemberDAL
- func (dal MemberDAL) Insert(ctx *swe.Context, roomID int64, ts int64, uid int64, name string, ...) error
- func (dal MemberDAL) Page(ctx *swe.Context, roomID, tsBegin, tsEnd int64, offset, limit int, uid int64, ...) (int, []MembershipRecord, error)
- func (dal MemberDAL) Range(ctx *swe.Context, roomID, tsBegin, tsEnd int64) ([]*MembershipRecord, error)
- type MembershipRecord
- type PublicKeyMap
- type RewardEvent
- type RewardEventDAL
- func (dal RewardEventDAL) BlockUser(ctx *swe.Context, eventID, uid int64, block bool) (bool, error)
- func (dal RewardEventDAL) ClearUsers(ctx *swe.Context, eventID int64) error
- func (dal RewardEventDAL) Delete(ctx *swe.Context, id, roomID int64) (int64, error)
- func (dal RewardEventDAL) Exist(ctx *swe.Context, id, roomID int64) (bool, error)
- func (dal RewardEventDAL) Get(ctx *swe.Context, id int64) (*RewardEvent, error)
- func (dal RewardEventDAL) GetByIDs(ctx *swe.Context, eventIDs []int64) ([]RewardEvent, error)
- func (dal RewardEventDAL) GetByRoomID(ctx *swe.Context, id, roomID int64) (*RewardEvent, error)
- func (dal RewardEventDAL) Page(ctx *swe.Context, roomID int64, offset, limit int) (int, []RewardEvent, error)
- func (dal RewardEventDAL) Put(ctx *swe.Context, item *RewardEvent) error
- func (dal RewardEventDAL) PutUsers(ctx *swe.Context, users []RewardUser) error
- func (dal RewardEventDAL) SetStatus(ctx *swe.Context, id int64, status int) error
- func (dal RewardEventDAL) UpdateAddrInfo(ctx *swe.Context, uid, eventID int64, addr string) (int64, error)
- func (dal RewardEventDAL) UpdateEventInfo(ctx *swe.Context, id, roomID int64, name, content string, hidden int) error
- func (dal RewardEventDAL) UserInfoByUIDAndEventID(ctx *swe.Context, uid, eventID int64) ([]RewardUser, error)
- func (dal RewardEventDAL) UserPage(ctx *swe.Context, eventID int64, offset, limit int) (int, []RewardUser, error)
- func (dal RewardEventDAL) UserRecords(ctx *swe.Context, uid int64, offset, limit int) (int, []RewardUser, error)
- func (dal RewardEventDAL) Users(ctx *swe.Context, eventID int64) ([]RewardUser, error)
- type RewardUser
- type SCDal
- func (dal SCDal) Insert(ctx *swe.Context, roomID int64, ts int64, uid int64, name string, price int64, ...) error
- func (dal SCDal) Page(ctx *swe.Context, roomID, tsBegin, tsEnd int64, offset, limit int, uid int64, ...) (int, []SuperChatRecord, error)
- func (dal SCDal) Range(ctx *swe.Context, roomID, tsBegin, tsEnd int64) ([]*SuperChatRecord, error)
- type Streamer
- type StreamerDAL
- func (dal StreamerDAL) All(ctx *swe.Context) ([]Streamer, error)
- func (dal StreamerDAL) Delete(ctx *swe.Context, id int64) (int64, error)
- func (dal StreamerDAL) Find(ctx *swe.Context, id int64) (*Streamer, error)
- func (dal StreamerDAL) FindByAccount(ctx *swe.Context, account string) (*Streamer, error)
- func (dal StreamerDAL) FindByRoomIDs(ctx *swe.Context, roomIDs []int64) ([]Streamer, error)
- func (dal StreamerDAL) Insert(ctx *swe.Context, data *Streamer, upsert bool) (int64, error)
- func (dal StreamerDAL) Page(ctx *swe.Context, offset, limit int) (int, []Streamer, error)
- func (dal StreamerDAL) UpdatePrivateKey(ctx *swe.Context, id int64, b64EncPriKey string) error
- type SuperChatRecord
- type SysConfig
- type SysConfigDAL
Constants ¶
View Source
const ( ASYNC_TASK_IDLE = iota + 1 ASYNC_TASK_RUNNING ASYNC_TASK_FAILED ASYNC_TASK_DONE )
View Source
const ( DM_TASK_STATUS_PAUSED = iota + 1 DM_TASK_STATUS_RUNNING DM_TASK_STATUS_DONE )
View Source
const ( DM_DETAIL_STATUS_NOT_SEND = iota + 1 DM_DETAIL_STATUS_FAIL DM_DETAIL_STATUS_DONE )
View Source
const ( EVENT_IDLE = iota + 1 EVENT_CALCULATING EVENT_ERROR EVENT_READY )
View Source
const (
DB_SYSCONF_ADMIN_PASS = "admin_pass"
)
View Source
const (
GORM_CTX_KEY gormCtxKey = "swe_ctx"
)
Variables ¶
This section is empty.
Functions ¶
func InitSQLite ¶
Types ¶
type AsyncTask ¶
type AsyncTaskDAL ¶
type AsyncTaskDAL struct{}
func GetAsyncTaskDAL ¶
func GetAsyncTaskDAL() AsyncTaskDAL
type DDInfo ¶
type DDInfo struct { UID int64 `gorm:"primaryKey;column:uid"` UserName string `gorm:"type:string;size:256"` AccessCode string `gorm:"type:string;size:64;index:idx_dd_ac,unique;column:access_code"` PrivateKey string `gorm:"type:string;size:256;column:private_key"` PublicKey string `gorm:"type:string;size:256;column:public_key"` }
type DDInfoDAL ¶
type DDInfoDAL struct {
// contains filtered or unexported fields
}
func GetDDInfoDAL ¶
func GetDDInfoDAL() *DDInfoDAL
func (DDInfoDAL) BatchCreate ¶
func (*DDInfoDAL) GenerateAccessCode ¶
func (*DDInfoDAL) GetByAccessCode ¶
func (*DDInfoDAL) GetPublicKeys ¶
type DMDetail ¶
type DMDetail struct { TaskID int64 `gorm:"column:task_id;index:idx_dm_task"` RecieverUID int64 `gorm:"column:uid;index:idx_dm_task"` Content string `gorm:"column:content;type:TEXT"` Status int `gorm:"column:status"` SendTime int64 `gorm:"column:send_ts"` FailReason string `gorm:"column:fail_reason;type:string;size:1024"` }
type DMTask ¶
type DMTask struct { ID int64 `gorm:"primaryKey;column:id"` RoomID int64 `gorm:"column:room_id;index:idx_dmtask_room"` EventID int64 `gorm:"column:event_id"` TaskName string `gorm:"column:task_name;type:string;size:256"` MsgType int `gorm:"column:msg_type"` Content string `gorm:"column:content;type:string;size:4096"` BatchMax int `gorm:"column:batch_max"` Status int `gorm:"column:status"` IntervalMin int `gorm:"column:interval_min"` IntervalMax int `gorm:"column:interval_max"` CreateTime int64 `gorm:"create_time"` }
type DMTaskStat ¶
type DirectMsgDAL ¶
type DirectMsgDAL struct{}
func GetDirectMsgDAL ¶
func GetDirectMsgDAL() DirectMsgDAL
func (DirectMsgDAL) BatchCreateDetails ¶
func (dal DirectMsgDAL) BatchCreateDetails(ctx *swe.Context, details []DMDetail) error
func (DirectMsgDAL) GetByRoomID ¶
func (DirectMsgDAL) LoadUnsentDetails ¶
func (DirectMsgDAL) Stats ¶
func (dal DirectMsgDAL) Stats(ctx *swe.Context, id int64) (DMTaskStat, error)
func (DirectMsgDAL) UpdateDetailStatus ¶
func (DirectMsgDAL) UpdateStatus ¶
type GiftDAL ¶
type GiftDAL struct{}
func GetGiftDAL ¶
func GetGiftDAL() GiftDAL
type GiftInfo ¶
type GiftRecord ¶
type GiftRecord struct { BatchID string `gorm:"type:string;size:1024;column:batch_id;primaryKey" json:"-"` RoomID int64 `gorm:"index:idx_gift_room_time;column:room_id" json:"-"` SendTime int64 `gorm:"index:idx_gift_room_time;column:send_time"` SenderUID int64 `gorm:"column:sender_uid" json:"-"` SenderName string `gorm:"type:string;size:256;column:sender_name" json:"-"` GiftID int64 `gorm:"column:gift_id"` GiftName string `gorm:"type:string;size:256"` GiftPrice int64 GiftCount int64 `gorm:"column:gift_count"` }
func (GiftRecord) TableName ¶
func (s GiftRecord) TableName() string
type MemberDAL ¶
type MemberDAL struct{}
func GetMemberDal ¶
func GetMemberDal() MemberDAL
type MembershipRecord ¶
type MembershipRecord struct { RoomID int64 `gorm:"index:idx_member_room_time;column:room_id" json:"-"` SendTime int64 `gorm:"index:idx_member_room_time;column:send_time"` SenderUID int64 `gorm:"column:sender_uid" json:"-"` SenderName string `gorm:"type:string;size:256;column:sender_name" json:"-"` GuardLevel int `gorm:"column:level"` Count int }
func (MembershipRecord) TableName ¶
func (s MembershipRecord) TableName() string
type PublicKeyMap ¶
type RewardEvent ¶
type RewardEvent struct { ID int64 `gorm:"primaryKey;column:id"` RoomID int64 `gorm:"index:idx_re_room;column:room_id"` EventName string `gorm:"type:string;size:256;column:name"` RewardContent string `gorm:"type:TEXT;column:content"` Conditions string `gorm:"type:TEXT;column:conditions"` Hidden int `gorm:"column:hidden"` CreateTime int64 `gorm:"index:idx_re_room;column:create_time"` Status int `gorm:"column:status"` }
func (RewardEvent) TableName ¶
func (s RewardEvent) TableName() string
type RewardEventDAL ¶
type RewardEventDAL struct{}
func GetRewardEventDAL ¶
func GetRewardEventDAL() RewardEventDAL
func (RewardEventDAL) ClearUsers ¶
func (dal RewardEventDAL) ClearUsers(ctx *swe.Context, eventID int64) error
func (RewardEventDAL) Get ¶
func (dal RewardEventDAL) Get(ctx *swe.Context, id int64) (*RewardEvent, error)
func (RewardEventDAL) GetByIDs ¶
func (dal RewardEventDAL) GetByIDs(ctx *swe.Context, eventIDs []int64) ([]RewardEvent, error)
func (RewardEventDAL) GetByRoomID ¶
func (dal RewardEventDAL) GetByRoomID(ctx *swe.Context, id, roomID int64) (*RewardEvent, error)
func (RewardEventDAL) Page ¶
func (dal RewardEventDAL) Page(ctx *swe.Context, roomID int64, offset, limit int) (int, []RewardEvent, error)
func (RewardEventDAL) Put ¶
func (dal RewardEventDAL) Put(ctx *swe.Context, item *RewardEvent) error
func (RewardEventDAL) PutUsers ¶
func (dal RewardEventDAL) PutUsers(ctx *swe.Context, users []RewardUser) error
func (RewardEventDAL) UpdateAddrInfo ¶
func (RewardEventDAL) UpdateEventInfo ¶
func (RewardEventDAL) UserInfoByUIDAndEventID ¶
func (dal RewardEventDAL) UserInfoByUIDAndEventID(ctx *swe.Context, uid, eventID int64) ([]RewardUser, error)
func (RewardEventDAL) UserPage ¶
func (dal RewardEventDAL) UserPage(ctx *swe.Context, eventID int64, offset, limit int) (int, []RewardUser, error)
func (RewardEventDAL) UserRecords ¶
func (dal RewardEventDAL) UserRecords(ctx *swe.Context, uid int64, offset, limit int) (int, []RewardUser, error)
func (RewardEventDAL) Users ¶
func (dal RewardEventDAL) Users(ctx *swe.Context, eventID int64) ([]RewardUser, error)
type RewardUser ¶
type RewardUser struct { EventID int64 `gorm:"index:idx_ru_evt;column:event_id"` UID int64 `gorm:"index:idx_ru_uid;column:uid"` UserName string `gorm:"type:string;size:256;column:user_name"` Time int64 `gorm:"column:ts"` Blocked int `gorm:"column:block"` Columns string `gorm:"type:TEXT;column:cols"` AddressInfo string `gorm:"type:string;size:4096;column:address_info"` }
func (RewardUser) TableName ¶
func (s RewardUser) TableName() string
type Streamer ¶
type Streamer struct { RoomID int64 `gorm:"primaryKey;column:room_id"` StreamerName string `gorm:"type:string;size:256"` AccountName string `gorm:"type:string;size:256;index:idx_accname,unique;column:account_name"` PrivateKey string `gorm:"type:string;size:256;column:private_key"` PublicKey string `gorm:"type:string;size:256;column:public_key"` }
type StreamerDAL ¶
type StreamerDAL struct{}
func GetStreamerDAL ¶
func GetStreamerDAL() StreamerDAL
func (StreamerDAL) FindByAccount ¶
func (StreamerDAL) FindByRoomIDs ¶
func (StreamerDAL) UpdatePrivateKey ¶
type SuperChatRecord ¶
type SuperChatRecord struct { RoomID int64 `gorm:"index:idx_sc_room_time;column:room_id" json:"-"` SendTime int64 `gorm:"index:idx_sc_room_time;column:send_time"` SenderUID int64 `gorm:"column:sender_uid" json:"-"` SenderName string `gorm:"type:string;size:256;column:sender_name" json:"-"` Price int64 Content string `gorm:"type:string;size:1024;column:content"` BgColor string `gorm:"type:string;size:32"` FontColor string `gorm:"type:string;size:32"` }
func (SuperChatRecord) TableName ¶
func (s SuperChatRecord) TableName() string
type SysConfig ¶
type SysConfigDAL ¶
type SysConfigDAL struct{}
func GetSysConfigDAL ¶
func GetSysConfigDAL() SysConfigDAL
func (SysConfigDAL) EncodeAdminPassword ¶
func (dal SysConfigDAL) EncodeAdminPassword(pass string) string
Click to show internal directories.
Click to hide internal directories.