userModel

package
v0.0.0-...-506abc5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// CollectionUser holds the name of the articles collection
	CollectionUser = "users"
)

Variables

This section is empty.

Functions

func Delete

func Delete(userId string) (int64, error)

func Find

func Find(user User) (*[]User, error)

func FindCount

func FindCount(user User) (int64, error)

Types

type Profile

type Profile struct {
	Type    string `json:"type"`
	Id      string `json:"id"`
	Link    string `json:"link"`
	Name    string `json:"name"`
	Picture string `json:"picture"`
}

type User

type User struct {
	Id            string     `json:"id" bson:"_id,omitempty"`
	Email         *string    `json:"email" bson:"email,omitempty"`
	Locale        string     `json:"locale" bson:"locale,omitempty"`
	Password      string     `json:"password" bson:"password,omitempty"`
	PasswordRetry string     `json:"retryPassword" bson:"-"`
	RecoveryToken string     `json:"recoveryToken" bson:"-"`
	Gender        string     `json:"gender" bson:"-"`
	Profiles      []Profile  `json:"profiles" bson:"profiles,omitempty"`
	CreatedAt     *time.Time `json:"created_at" bson:"created_at,omitempty"`
	UpdatedAt     *time.Time `json:"updated_at" bson:"updated_at,omitempty"`
}

User model

func Add

func Add(user User) (error, User)

func FindOne

func FindOne(user User) (*User, error)

func List

func List() (error, []User)

func Update

func Update(user *User) (*User, error)

Jump to

Keyboard shortcuts

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