Documentation ¶
Index ¶
- type AdminDatabase
- func (o *AdminDatabase) AddAdminAccount(ctx context.Context, admins []*table.Admin) error
- func (o *AdminDatabase) AddDefaultFriend(ctx context.Context, ms []*table.RegisterAddFriend) error
- func (o *AdminDatabase) AddDefaultGroup(ctx context.Context, ms []*table.RegisterAddGroup) error
- func (o *AdminDatabase) AddIPForbidden(ctx context.Context, ms []*table.IPForbidden) error
- func (o *AdminDatabase) AddUserLimitLogin(ctx context.Context, ms []*table.LimitUserLoginIP) error
- func (o *AdminDatabase) BlockUser(ctx context.Context, f []*table.ForbiddenAccount) error
- func (o *AdminDatabase) CacheToken(ctx context.Context, userID string, token string) error
- func (o *AdminDatabase) ChangePassword(ctx context.Context, userID string, newPassword string) error
- func (o *AdminDatabase) CountLimitUserLoginIP(ctx context.Context, userID string) (uint32, error)
- func (o *AdminDatabase) CreatInvitationRegister(ctx context.Context, invitationRegisters []*table.InvitationRegister) error
- func (o *AdminDatabase) CreateApplet(ctx context.Context, applets []*table.Applet) error
- func (o *AdminDatabase) DelAdminAccount(ctx context.Context, userIDs []string) error
- func (o *AdminDatabase) DelApplet(ctx context.Context, appletIDs []string) error
- func (o *AdminDatabase) DelBlockUser(ctx context.Context, userID []string) error
- func (o *AdminDatabase) DelConfig(ctx context.Context, keys []string) error
- func (o *AdminDatabase) DelDefaultFriend(ctx context.Context, userIDs []string) error
- func (o *AdminDatabase) DelDefaultGroup(ctx context.Context, groupIDs []string) error
- func (o *AdminDatabase) DelIPForbidden(ctx context.Context, ips []string) error
- func (o *AdminDatabase) DelInvitationRegister(ctx context.Context, codes []string) error
- func (o *AdminDatabase) DelUserLimitLogin(ctx context.Context, ms []*table.LimitUserLoginIP) error
- func (o *AdminDatabase) FindApplet(ctx context.Context, appletIDs []string) ([]*table.Applet, error)
- func (o *AdminDatabase) FindBlockInfo(ctx context.Context, userIDs []string) ([]*table.ForbiddenAccount, error)
- func (o *AdminDatabase) FindBlockUser(ctx context.Context, userIDs []string) ([]*table.ForbiddenAccount, error)
- func (o *AdminDatabase) FindDefaultFriend(ctx context.Context, userIDs []string) ([]string, error)
- func (o *AdminDatabase) FindDefaultGroup(ctx context.Context, groupIDs []string) ([]string, error)
- func (o *AdminDatabase) FindIPForbidden(ctx context.Context, ms []string) ([]*table.IPForbidden, error)
- func (o *AdminDatabase) FindInvitationRegister(ctx context.Context, codes []string) ([]*table.InvitationRegister, error)
- func (o *AdminDatabase) FindOnShelf(ctx context.Context) ([]*table.Applet, error)
- func (o *AdminDatabase) GetAdmin(ctx context.Context, account string) (*table.Admin, error)
- func (o *AdminDatabase) GetAdminUserID(ctx context.Context, userID string) (*table.Admin, error)
- func (o *AdminDatabase) GetApplet(ctx context.Context, appletID string) (*table.Applet, error)
- func (o *AdminDatabase) GetBlockInfo(ctx context.Context, userID string) (*table.ForbiddenAccount, error)
- func (o *AdminDatabase) GetConfig(ctx context.Context) (map[string]string, error)
- func (o *AdminDatabase) GetLimitUserLoginIP(ctx context.Context, userID string, ip string) (*table.LimitUserLoginIP, error)
- func (o *AdminDatabase) GetTokens(ctx context.Context, userID string) (map[string]int32, error)
- func (o *AdminDatabase) SearchAdminAccount(ctx context.Context, pagination pagination.Pagination) (int64, []*table.Admin, error)
- func (o *AdminDatabase) SearchApplet(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.Applet, error)
- func (o *AdminDatabase) SearchBlockUser(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.ForbiddenAccount, error)
- func (o *AdminDatabase) SearchDefaultFriend(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.RegisterAddFriend, error)
- func (o *AdminDatabase) SearchDefaultGroup(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.RegisterAddGroup, error)
- func (o *AdminDatabase) SearchIPForbidden(ctx context.Context, keyword string, state int32, ...) (int64, []*table.IPForbidden, error)
- func (o *AdminDatabase) SearchInvitationRegister(ctx context.Context, keyword string, state int32, userIDs []string, ...) (int64, []*table.InvitationRegister, error)
- func (o *AdminDatabase) SearchUserLimitLogin(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.LimitUserLoginIP, error)
- func (o *AdminDatabase) SetConfig(ctx context.Context, cs map[string]string) error
- func (o *AdminDatabase) UpdateAdmin(ctx context.Context, userID string, update map[string]any) error
- func (o *AdminDatabase) UpdateApplet(ctx context.Context, appletID string, update map[string]any) error
- func (o *AdminDatabase) UpdateInvitationRegister(ctx context.Context, code string, fields map[string]any) error
- type AdminDatabaseInterface
- type ChatDatabase
- func (o *ChatDatabase) AddVerifyCode(ctx context.Context, verifyCode *table.VerifyCode, fn func() error) error
- func (o *ChatDatabase) CountVerifyCodeRange(ctx context.Context, account string, start time.Time, end time.Time) (int64, error)
- func (o *ChatDatabase) DelVerifyCode(ctx context.Context, id string) error
- func (o *ChatDatabase) FindAttribute(ctx context.Context, userIDs []string) ([]*table.Attribute, error)
- func (o *ChatDatabase) FindAttributeByAccount(ctx context.Context, accounts []string) ([]*table.Attribute, error)
- func (o *ChatDatabase) GetAccount(ctx context.Context, userID string) (*table.Account, error)
- func (o *ChatDatabase) GetAttribute(ctx context.Context, userID string) (*table.Attribute, error)
- func (o *ChatDatabase) GetAttributeByAccount(ctx context.Context, account string) (*table.Attribute, error)
- func (o *ChatDatabase) GetAttributeByEmail(ctx context.Context, email string) (*table.Attribute, error)
- func (o *ChatDatabase) GetAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*table.Attribute, error)
- func (o *ChatDatabase) GetUser(ctx context.Context, userID string) (account *table.Account, err error)
- func (o *ChatDatabase) LoginRecord(ctx context.Context, record *table.UserLoginRecord, verifyCodeID *string) error
- func (o *ChatDatabase) NewUserCountTotal(ctx context.Context, before *time.Time) (int64, error)
- func (o *ChatDatabase) RegisterUser(ctx context.Context, register *table.Register, account *table.Account, ...) error
- func (o *ChatDatabase) Search(ctx context.Context, normalUser int32, keyword string, genders int32, ...) (total int64, attributes []*table.Attribute, err error)
- func (o *ChatDatabase) SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, ...) (int64, []*table.Attribute, error)
- func (o *ChatDatabase) TakeAttributeByAccount(ctx context.Context, account string) (*table.Attribute, error)
- func (o *ChatDatabase) TakeAttributeByEmail(ctx context.Context, email string) (*table.Attribute, error)
- func (o *ChatDatabase) TakeAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*table.Attribute, error)
- func (o *ChatDatabase) TakeAttributeByUserID(ctx context.Context, userID string) (*table.Attribute, error)
- func (o *ChatDatabase) TakeLastVerifyCode(ctx context.Context, account string) (*table.VerifyCode, error)
- func (o *ChatDatabase) UpdatePassword(ctx context.Context, userID string, password string) error
- func (o *ChatDatabase) UpdatePasswordAndDeleteVerifyCode(ctx context.Context, userID string, password string, codeID string) error
- func (o *ChatDatabase) UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any) (err error)
- func (o *ChatDatabase) UpdateVerifyCodeIncrCount(ctx context.Context, id string) error
- func (o *ChatDatabase) UserLoginCountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error)
- func (o *ChatDatabase) UserLoginCountTotal(ctx context.Context, before *time.Time) (int64, error)
- type ChatDatabaseInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminDatabase ¶
type AdminDatabase struct {
// contains filtered or unexported fields
}
func (*AdminDatabase) AddAdminAccount ¶
func (*AdminDatabase) AddDefaultFriend ¶
func (o *AdminDatabase) AddDefaultFriend(ctx context.Context, ms []*table.RegisterAddFriend) error
func (*AdminDatabase) AddDefaultGroup ¶
func (o *AdminDatabase) AddDefaultGroup(ctx context.Context, ms []*table.RegisterAddGroup) error
func (*AdminDatabase) AddIPForbidden ¶
func (o *AdminDatabase) AddIPForbidden(ctx context.Context, ms []*table.IPForbidden) error
func (*AdminDatabase) AddUserLimitLogin ¶
func (o *AdminDatabase) AddUserLimitLogin(ctx context.Context, ms []*table.LimitUserLoginIP) error
func (*AdminDatabase) BlockUser ¶
func (o *AdminDatabase) BlockUser(ctx context.Context, f []*table.ForbiddenAccount) error
func (*AdminDatabase) CacheToken ¶
func (*AdminDatabase) ChangePassword ¶
func (*AdminDatabase) CountLimitUserLoginIP ¶
func (*AdminDatabase) CreatInvitationRegister ¶
func (o *AdminDatabase) CreatInvitationRegister(ctx context.Context, invitationRegisters []*table.InvitationRegister) error
func (*AdminDatabase) CreateApplet ¶
func (*AdminDatabase) DelAdminAccount ¶
func (o *AdminDatabase) DelAdminAccount(ctx context.Context, userIDs []string) error
func (*AdminDatabase) DelApplet ¶
func (o *AdminDatabase) DelApplet(ctx context.Context, appletIDs []string) error
func (*AdminDatabase) DelBlockUser ¶
func (o *AdminDatabase) DelBlockUser(ctx context.Context, userID []string) error
func (*AdminDatabase) DelConfig ¶
func (o *AdminDatabase) DelConfig(ctx context.Context, keys []string) error
func (*AdminDatabase) DelDefaultFriend ¶
func (o *AdminDatabase) DelDefaultFriend(ctx context.Context, userIDs []string) error
func (*AdminDatabase) DelDefaultGroup ¶
func (o *AdminDatabase) DelDefaultGroup(ctx context.Context, groupIDs []string) error
func (*AdminDatabase) DelIPForbidden ¶
func (o *AdminDatabase) DelIPForbidden(ctx context.Context, ips []string) error
func (*AdminDatabase) DelInvitationRegister ¶
func (o *AdminDatabase) DelInvitationRegister(ctx context.Context, codes []string) error
func (*AdminDatabase) DelUserLimitLogin ¶
func (o *AdminDatabase) DelUserLimitLogin(ctx context.Context, ms []*table.LimitUserLoginIP) error
func (*AdminDatabase) FindApplet ¶
func (*AdminDatabase) FindBlockInfo ¶
func (o *AdminDatabase) FindBlockInfo(ctx context.Context, userIDs []string) ([]*table.ForbiddenAccount, error)
func (*AdminDatabase) FindBlockUser ¶
func (o *AdminDatabase) FindBlockUser(ctx context.Context, userIDs []string) ([]*table.ForbiddenAccount, error)
func (*AdminDatabase) FindDefaultFriend ¶
func (*AdminDatabase) FindDefaultGroup ¶
func (*AdminDatabase) FindIPForbidden ¶
func (o *AdminDatabase) FindIPForbidden(ctx context.Context, ms []string) ([]*table.IPForbidden, error)
func (*AdminDatabase) FindInvitationRegister ¶
func (o *AdminDatabase) FindInvitationRegister(ctx context.Context, codes []string) ([]*table.InvitationRegister, error)
func (*AdminDatabase) FindOnShelf ¶
func (*AdminDatabase) GetAdminUserID ¶
func (*AdminDatabase) GetBlockInfo ¶
func (o *AdminDatabase) GetBlockInfo(ctx context.Context, userID string) (*table.ForbiddenAccount, error)
func (*AdminDatabase) GetLimitUserLoginIP ¶
func (o *AdminDatabase) GetLimitUserLoginIP(ctx context.Context, userID string, ip string) (*table.LimitUserLoginIP, error)
func (*AdminDatabase) SearchAdminAccount ¶
func (o *AdminDatabase) SearchAdminAccount(ctx context.Context, pagination pagination.Pagination) (int64, []*table.Admin, error)
func (*AdminDatabase) SearchApplet ¶
func (o *AdminDatabase) SearchApplet(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.Applet, error)
func (*AdminDatabase) SearchBlockUser ¶
func (o *AdminDatabase) SearchBlockUser(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.ForbiddenAccount, error)
func (*AdminDatabase) SearchDefaultFriend ¶
func (o *AdminDatabase) SearchDefaultFriend(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.RegisterAddFriend, error)
func (*AdminDatabase) SearchDefaultGroup ¶
func (o *AdminDatabase) SearchDefaultGroup(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.RegisterAddGroup, error)
func (*AdminDatabase) SearchIPForbidden ¶
func (o *AdminDatabase) SearchIPForbidden(ctx context.Context, keyword string, state int32, pagination pagination.Pagination) (int64, []*table.IPForbidden, error)
func (*AdminDatabase) SearchInvitationRegister ¶
func (o *AdminDatabase) SearchInvitationRegister(ctx context.Context, keyword string, state int32, userIDs []string, codes []string, pagination pagination.Pagination) (int64, []*table.InvitationRegister, error)
func (*AdminDatabase) SearchUserLimitLogin ¶
func (o *AdminDatabase) SearchUserLimitLogin(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.LimitUserLoginIP, error)
func (*AdminDatabase) UpdateAdmin ¶
func (*AdminDatabase) UpdateApplet ¶
func (*AdminDatabase) UpdateInvitationRegister ¶
type AdminDatabaseInterface ¶
type AdminDatabaseInterface interface { GetAdmin(ctx context.Context, account string) (*table.Admin, error) GetAdminUserID(ctx context.Context, userID string) (*table.Admin, error) UpdateAdmin(ctx context.Context, userID string, update map[string]any) error ChangePassword(ctx context.Context, userID string, newPassword string) error AddAdminAccount(ctx context.Context, admin []*table.Admin) error DelAdminAccount(ctx context.Context, userIDs []string) error SearchAdminAccount(ctx context.Context, pagination pagination.Pagination) (int64, []*table.Admin, error) CreateApplet(ctx context.Context, applets []*table.Applet) error DelApplet(ctx context.Context, appletIDs []string) error GetApplet(ctx context.Context, appletID string) (*table.Applet, error) FindApplet(ctx context.Context, appletIDs []string) ([]*table.Applet, error) SearchApplet(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.Applet, error) FindOnShelf(ctx context.Context) ([]*table.Applet, error) UpdateApplet(ctx context.Context, appletID string, update map[string]any) error GetConfig(ctx context.Context) (map[string]string, error) SetConfig(ctx context.Context, cs map[string]string) error DelConfig(ctx context.Context, keys []string) error FindInvitationRegister(ctx context.Context, codes []string) ([]*table.InvitationRegister, error) DelInvitationRegister(ctx context.Context, codes []string) error UpdateInvitationRegister(ctx context.Context, code string, fields map[string]any) error CreatInvitationRegister(ctx context.Context, invitationRegisters []*table.InvitationRegister) error SearchInvitationRegister(ctx context.Context, keyword string, state int32, userIDs []string, codes []string, pagination pagination.Pagination) (int64, []*table.InvitationRegister, error) SearchIPForbidden(ctx context.Context, keyword string, state int32, pagination pagination.Pagination) (int64, []*table.IPForbidden, error) AddIPForbidden(ctx context.Context, ms []*table.IPForbidden) error FindIPForbidden(ctx context.Context, ms []string) ([]*table.IPForbidden, error) DelIPForbidden(ctx context.Context, ips []string) error FindDefaultFriend(ctx context.Context, userIDs []string) ([]string, error) AddDefaultFriend(ctx context.Context, ms []*table.RegisterAddFriend) error DelDefaultFriend(ctx context.Context, userIDs []string) error SearchDefaultFriend(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.RegisterAddFriend, error) FindDefaultGroup(ctx context.Context, groupIDs []string) ([]string, error) AddDefaultGroup(ctx context.Context, ms []*table.RegisterAddGroup) error DelDefaultGroup(ctx context.Context, groupIDs []string) error SearchDefaultGroup(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.RegisterAddGroup, error) FindBlockInfo(ctx context.Context, userIDs []string) ([]*table.ForbiddenAccount, error) GetBlockInfo(ctx context.Context, userID string) (*table.ForbiddenAccount, error) BlockUser(ctx context.Context, f []*table.ForbiddenAccount) error DelBlockUser(ctx context.Context, userID []string) error SearchBlockUser(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.ForbiddenAccount, error) FindBlockUser(ctx context.Context, userIDs []string) ([]*table.ForbiddenAccount, error) SearchUserLimitLogin(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*table.LimitUserLoginIP, error) AddUserLimitLogin(ctx context.Context, ms []*table.LimitUserLoginIP) error DelUserLimitLogin(ctx context.Context, ms []*table.LimitUserLoginIP) error CountLimitUserLoginIP(ctx context.Context, userID string) (uint32, error) GetLimitUserLoginIP(ctx context.Context, userID string, ip string) (*table.LimitUserLoginIP, error) CacheToken(ctx context.Context, userID string, token string) error GetTokens(ctx context.Context, userID string) (map[string]int32, error) }
func NewAdminDatabase ¶
func NewAdminDatabase(cli *mongoutil.Client, rdb redis.UniversalClient) (AdminDatabaseInterface, error)
type ChatDatabase ¶
type ChatDatabase struct {
// contains filtered or unexported fields
}
func (*ChatDatabase) AddVerifyCode ¶
func (o *ChatDatabase) AddVerifyCode(ctx context.Context, verifyCode *table.VerifyCode, fn func() error) error
func (*ChatDatabase) CountVerifyCodeRange ¶
func (*ChatDatabase) DelVerifyCode ¶
func (o *ChatDatabase) DelVerifyCode(ctx context.Context, id string) error
func (*ChatDatabase) FindAttribute ¶
func (*ChatDatabase) FindAttributeByAccount ¶
func (*ChatDatabase) GetAccount ¶
func (*ChatDatabase) GetAttribute ¶
func (*ChatDatabase) GetAttributeByAccount ¶
func (*ChatDatabase) GetAttributeByEmail ¶
func (*ChatDatabase) GetAttributeByPhone ¶
func (*ChatDatabase) LoginRecord ¶
func (o *ChatDatabase) LoginRecord(ctx context.Context, record *table.UserLoginRecord, verifyCodeID *string) error
func (*ChatDatabase) NewUserCountTotal ¶
func (*ChatDatabase) RegisterUser ¶
func (*ChatDatabase) Search ¶
func (o *ChatDatabase) Search(ctx context.Context, normalUser int32, keyword string, genders int32, pagination pagination.Pagination) (total int64, attributes []*table.Attribute, err error)
func (*ChatDatabase) SearchUser ¶
func (o *ChatDatabase) SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pagination pagination.Pagination) (int64, []*table.Attribute, error)
func (*ChatDatabase) TakeAttributeByAccount ¶
func (*ChatDatabase) TakeAttributeByEmail ¶
func (*ChatDatabase) TakeAttributeByPhone ¶
func (*ChatDatabase) TakeAttributeByUserID ¶
func (*ChatDatabase) TakeLastVerifyCode ¶
func (o *ChatDatabase) TakeLastVerifyCode(ctx context.Context, account string) (*table.VerifyCode, error)
func (*ChatDatabase) UpdatePassword ¶
func (*ChatDatabase) UpdatePasswordAndDeleteVerifyCode ¶
func (*ChatDatabase) UpdateUseInfo ¶
func (*ChatDatabase) UpdateVerifyCodeIncrCount ¶
func (o *ChatDatabase) UpdateVerifyCodeIncrCount(ctx context.Context, id string) error
func (*ChatDatabase) UserLoginCountRangeEverydayTotal ¶
func (*ChatDatabase) UserLoginCountTotal ¶
type ChatDatabaseInterface ¶
type ChatDatabaseInterface interface { GetUser(ctx context.Context, userID string) (account *table.Account, err error) UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any) (err error) FindAttribute(ctx context.Context, userIDs []string) ([]*table.Attribute, error) FindAttributeByAccount(ctx context.Context, accounts []string) ([]*table.Attribute, error) TakeAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*table.Attribute, error) TakeAttributeByEmail(ctx context.Context, Email string) (*table.Attribute, error) TakeAttributeByAccount(ctx context.Context, account string) (*table.Attribute, error) TakeAttributeByUserID(ctx context.Context, userID string) (*table.Attribute, error) Search(ctx context.Context, normalUser int32, keyword string, gender int32, pagination pagination.Pagination) (int64, []*table.Attribute, error) SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pagination pagination.Pagination) (int64, []*table.Attribute, error) CountVerifyCodeRange(ctx context.Context, account string, start time.Time, end time.Time) (int64, error) AddVerifyCode(ctx context.Context, verifyCode *table.VerifyCode, fn func() error) error UpdateVerifyCodeIncrCount(ctx context.Context, id string) error TakeLastVerifyCode(ctx context.Context, account string) (*table.VerifyCode, error) DelVerifyCode(ctx context.Context, id string) error RegisterUser(ctx context.Context, register *table.Register, account *table.Account, attribute *table.Attribute) error GetAccount(ctx context.Context, userID string) (*table.Account, error) GetAttribute(ctx context.Context, userID string) (*table.Attribute, error) GetAttributeByAccount(ctx context.Context, account string) (*table.Attribute, error) GetAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*table.Attribute, error) GetAttributeByEmail(ctx context.Context, email string) (*table.Attribute, error) LoginRecord(ctx context.Context, record *table.UserLoginRecord, verifyCodeID *string) error UpdatePassword(ctx context.Context, userID string, password string) error UpdatePasswordAndDeleteVerifyCode(ctx context.Context, userID string, password string, codeID string) error NewUserCountTotal(ctx context.Context, before *time.Time) (int64, error) UserLoginCountTotal(ctx context.Context, before *time.Time) (int64, error) UserLoginCountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error) }
func NewChatDatabase ¶
func NewChatDatabase(cli *mongoutil.Client) (ChatDatabaseInterface, error)
Click to show internal directories.
Click to hide internal directories.