database

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(connectionURI string) *mongo.Database

New creates a new database client connection

Types

type UserProfiles

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

func (*UserProfiles) Get

func (u *UserProfiles) Get(userID string) (model.Userprofile, error)

Get returns the requested userprofile

func (*UserProfiles) Save

func (u *UserProfiles) Save(up model.Userprofile) error

Save saves the userprofile in the parameter. If the userprofile for the given UserId already exists, then it updates the fields

type UserProfilesCollection

type UserProfilesCollection interface {
	Save(up model.Userprofile) error
	Get(userID string) (model.Userprofile, error)
}

func NewUserProfile

func NewUserProfile(db *mongo.Database) UserProfilesCollection

NewUserProfile creates a new object to manipulate the collection

Jump to

Keyboard shortcuts

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