mongo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(db *mongo.Database) *Manager

NewManager creates a mongo manager.

func (*Manager) DeleteProfile

func (m *Manager) DeleteProfile(c context.Context, aid id.AccountID) error

DeleteProfile delete profile

func (*Manager) GetPendingProfiles

func (m *Manager) GetPendingProfiles(c context.Context) ([]*ProfileRecord, error)

GetPendingProfiles gets peding profiles.

func (*Manager) GetProfile

func (m *Manager) GetProfile(c context.Context, aid id.AccountID) (*ProfileRecord, error)

GetProfile gets profile for an account.

func (*Manager) GetProfiles

func (m *Manager) GetProfiles(c context.Context, limit int64) ([]*ProfileRecord, error)

GetProfiles gets profiles.

func (*Manager) UpdateProfile

func (m *Manager) UpdateProfile(c context.Context, aid id.AccountID, prevState base.IdentityStatus, p *base.Profile) error

UpdateProfile updates profile for an account.

func (*Manager) UpdateProfilePhoto

func (m *Manager) UpdateProfilePhoto(c context.Context, aid id.AccountID, bid id.BlobID) error

UpdateProfilePhoto updates profile photo blob id.

func (*Manager) UpdateProfileStatus added in v0.2.1

func (m *Manager) UpdateProfileStatus(c context.Context, aid id.AccountID, status base.IdentityStatus) error

UpdateProfileStatus updates profile status.

type ProfileRecord

type ProfileRecord struct {
	AccountID   string        `bson:"accountid"`
	Profile     *base.Profile `bson:"profile"`
	PhotoBlobID string        `bson:"photoblobid"`
}

ProfileRecord defines the profile record in db.

Jump to

Keyboard shortcuts

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