chat

package
v1.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccount

func NewAccount(db *mongo.Database) (chat.AccountInterface, error)

func NewAttribute

func NewAttribute(db *mongo.Database) (chat.AttributeInterface, error)

func NewCredential added in v1.8.3

func NewCredential(db *mongo.Database) (chat.CredentialInterface, error)

func NewRegister

func NewRegister(db *mongo.Database) (chat.RegisterInterface, error)

func NewUserLoginRecord

func NewUserLoginRecord(db *mongo.Database) (chat.UserLoginRecordInterface, error)

func NewVerifyCode

func NewVerifyCode(db *mongo.Database) (chat.VerifyCodeInterface, error)

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func (*Account) Create

func (o *Account) Create(ctx context.Context, accounts ...*chat.Account) error

func (*Account) Delete added in v1.8.0

func (o *Account) Delete(ctx context.Context, userIDs []string) error

func (*Account) Take

func (o *Account) Take(ctx context.Context, userId string) (*chat.Account, error)

func (*Account) Update

func (o *Account) Update(ctx context.Context, userID string, data map[string]any) error

func (*Account) UpdatePassword

func (o *Account) UpdatePassword(ctx context.Context, userId string, password string) error

type Attribute

type Attribute struct {
	// contains filtered or unexported fields
}

func (*Attribute) Create

func (o *Attribute) Create(ctx context.Context, attribute ...*chat.Attribute) error

func (*Attribute) Delete added in v1.8.0

func (o *Attribute) Delete(ctx context.Context, userIDs []string) error

func (*Attribute) Find

func (o *Attribute) Find(ctx context.Context, userIds []string) ([]*chat.Attribute, error)

func (*Attribute) FindAccount

func (o *Attribute) FindAccount(ctx context.Context, accounts []string) ([]*chat.Attribute, error)

func (*Attribute) FindPhone added in v1.8.0

func (o *Attribute) FindPhone(ctx context.Context, phoneNumbers []string) ([]*chat.Attribute, error)

func (*Attribute) Search

func (o *Attribute) Search(ctx context.Context, keyword string, genders []int32, pagination pagination.Pagination) (int64, []*chat.Attribute, error)

func (*Attribute) SearchNormalUser

func (o *Attribute) SearchNormalUser(ctx context.Context, keyword string, forbiddenIDs []string, gender int32, pagination pagination.Pagination) (int64, []*chat.Attribute, error)

func (*Attribute) SearchUser

func (o *Attribute) SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pagination pagination.Pagination) (int64, []*chat.Attribute, error)

func (*Attribute) Take

func (o *Attribute) Take(ctx context.Context, userID string) (*chat.Attribute, error)

func (*Attribute) TakeAccount

func (o *Attribute) TakeAccount(ctx context.Context, account string) (*chat.Attribute, error)

func (*Attribute) TakeEmail

func (o *Attribute) TakeEmail(ctx context.Context, email string) (*chat.Attribute, error)

func (*Attribute) TakePhone

func (o *Attribute) TakePhone(ctx context.Context, areaCode string, phoneNumber string) (*chat.Attribute, error)

func (*Attribute) Update

func (o *Attribute) Update(ctx context.Context, userID string, data map[string]any) error

type Credential added in v1.8.3

type Credential struct {
	// contains filtered or unexported fields
}

func (*Credential) Create added in v1.8.3

func (o *Credential) Create(ctx context.Context, credential ...*chat.Credential) error

func (*Credential) CreateOrUpdateAccount added in v1.8.3

func (o *Credential) CreateOrUpdateAccount(ctx context.Context, credential *chat.Credential) error

func (*Credential) Delete added in v1.8.3

func (o *Credential) Delete(ctx context.Context, userIDs []string) error

func (*Credential) DeleteByUserIDType added in v1.8.3

func (o *Credential) DeleteByUserIDType(ctx context.Context, credentials ...*chat.Credential) error

func (*Credential) Find added in v1.8.3

func (o *Credential) Find(ctx context.Context, userID string) ([]*chat.Credential, error)

func (*Credential) FindAccount added in v1.8.3

func (o *Credential) FindAccount(ctx context.Context, accounts []string) ([]*chat.Credential, error)

func (*Credential) Search added in v1.8.3

func (o *Credential) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*chat.Credential, error)

func (*Credential) SearchNormalUser added in v1.8.3

func (o *Credential) SearchNormalUser(ctx context.Context, keyword string, forbiddenIDs []string, pagination pagination.Pagination) (int64, []*chat.Credential, error)

func (*Credential) SearchUser added in v1.8.3

func (o *Credential) SearchUser(ctx context.Context, keyword string, userIDs []string, pagination pagination.Pagination) (int64, []*chat.Credential, error)

func (*Credential) Take added in v1.8.3

func (o *Credential) Take(ctx context.Context, userID string) (*chat.Credential, error)

func (*Credential) TakeAccount added in v1.8.3

func (o *Credential) TakeAccount(ctx context.Context, account string) (*chat.Credential, error)

func (*Credential) Update added in v1.8.3

func (o *Credential) Update(ctx context.Context, userID string, data map[string]any) error

type Register

type Register struct {
	// contains filtered or unexported fields
}

func (*Register) CountTotal

func (o *Register) CountTotal(ctx context.Context, before *time.Time) (int64, error)

func (*Register) Create

func (o *Register) Create(ctx context.Context, registers ...*chat.Register) error

func (*Register) Delete added in v1.8.0

func (o *Register) Delete(ctx context.Context, userIDs []string) error

type UserLoginRecord

type UserLoginRecord struct {
	// contains filtered or unexported fields
}

func (*UserLoginRecord) CountRangeEverydayTotal

func (o *UserLoginRecord) CountRangeEverydayTotal(ctx context.Context, start *time.Time, end *time.Time) (map[string]int64, int64, error)

func (*UserLoginRecord) CountTotal

func (o *UserLoginRecord) CountTotal(ctx context.Context, before *time.Time) (count int64, err error)

func (*UserLoginRecord) Create

func (o *UserLoginRecord) Create(ctx context.Context, records ...*chat.UserLoginRecord) error

type VerifyCode

type VerifyCode struct {
	// contains filtered or unexported fields
}

func (*VerifyCode) Add

func (o *VerifyCode) Add(ctx context.Context, ms []*chat.VerifyCode) error

func (*VerifyCode) Delete

func (o *VerifyCode) Delete(ctx context.Context, id string) error

func (*VerifyCode) Incr

func (o *VerifyCode) Incr(ctx context.Context, id string) error

func (*VerifyCode) RangeNum

func (o *VerifyCode) RangeNum(ctx context.Context, account string, start time.Time, end time.Time) (int64, error)

func (*VerifyCode) TakeLast

func (o *VerifyCode) TakeLast(ctx context.Context, account string) (*chat.VerifyCode, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL