db

package
v0.0.0-...-1b1fb7f Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateIndex

func PopulateIndex(c *mongo.Collection, key string, value int32, unique bool) (string, error)

PopulateIndex ...

Types

type Client

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

Client ...

func NewClient

func NewClient(config *root.MongoConfig) (*Client, error)

NewClient ...

func (*Client) Close

func (c *Client) Close()

Close ...

func (*Client) Copy

func (c *Client) Copy() *mongo.Client

Copy ...

type Session

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

Session ...

func NewSession

func NewSession(config *root.MongoConfig) (*Session, error)

NewSession ...

func (*Session) Close

func (s *Session) Close()

Close ...

func (*Session) Copy

func (s *Session) Copy() *mgo.Session

Copy ...

type UserModel

type UserModel struct {
	ID           primitive.ObjectID `json:"_id,omitempty" bson:"_id, omitempty"`
	FirstName    string             `json:"firstname" bson:"firstname"`
	LastName     string             `json:"lastname" bson:"lastname"`
	Email        string             `json:"email" bson:"email"`
	PasswordHash string             `json:"password" bson:"password"`
}

UserModel ...

func CreateUserModel

func CreateUserModel(u *root.User) (newUser *UserModel, err error)

CreateUserModel ...

func (*UserModel) ComparePasswordHash

func (u *UserModel) ComparePasswordHash(password string) bool

ComparePasswordHash ...

func (*UserModel) SetHashPassword

func (u *UserModel) SetHashPassword(password string) error

SetHashPassword ...

type UserService

type UserService struct {
	Collection *mongo.Collection
}

UserService ...

func NewUserService

func NewUserService(c *mongo.Client, config *root.MongoConfig) *UserService

NewUserService ...

Jump to

Keyboard shortcuts

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