model

package
v0.0.0-...-8a99b67 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProfileCollectionName

func NewProfileCollectionName() (key.Key, error)

func NewProfileKey

func NewProfileKey(id string) (key.Key, error)

Types

type Dao

type Dao struct {
	nosql.DocumentBase `bson:"-"`
	Data               *pb.Profile `bson:"data"`
}

func (*Dao) GetUid

func (d *Dao) GetUid() string

func (*Dao) Init

func (d *Dao) Init(id string, doc diface.ICollection, cache diface.ICache) error

func (*Dao) InitDefault

func (d *Dao) InitDefault(uid string, profile *pb.Profile) error

func (*Dao) ToProto

func (d *Dao) ToProto() *pb.Profile

func (*Dao) UpdateData

func (d *Dao) UpdateData(profile *pb.Profile) bool

type PrivateDao

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

func (*PrivateDao) GetAllProfiles

func (d *PrivateDao) GetAllProfiles(
	platformId string,
	channel string, page, size int64) ([]*pb.Profile, error)

GetAllProfiles get all profiles by page https://www.mongodb.com/docs/atlas/atlas-search/tutorial/pagination-tutorial/

func (*PrivateDao) GetProfileByNickname

func (d *PrivateDao) GetProfileByNickname(
	platformId string,
	channel string,
	name string,
	isRegex bool,
	page, size int64,
) ([]*pb.Profile, error)

GetProfileByNickname find profile name by regex https://www.mongodb.com/docs/manual/reference/operator/query/regex/

func (*PrivateDao) GetProfiles

func (d *PrivateDao) GetProfiles(platformId, channel string, uid ...string) ([]*pb.Profile, error)

GetProfiles get profile by uid

func (*PrivateDao) GetProfilesByAccount

func (d *PrivateDao) GetProfilesByAccount(val string) (*pb.Profile, error)

func (*PrivateDao) Init

func (d *PrivateDao) Init(db *mongo.Database) error

Jump to

Keyboard shortcuts

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