data

package
v0.0.0-...-fadc641 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDatastore

type MongoDatastore struct {
	Session *mongo.Client
	// contains filtered or unexported fields
}

func NewDatastore

func NewDatastore(config *config.GeneralConfig, logger *logrus.Logger) *MongoDatastore

func (*MongoDatastore) GetCollection

func (store *MongoDatastore) GetCollection(name string) *mongo.Collection

func (*MongoDatastore) GetUserRepository

func (store *MongoDatastore) GetUserRepository() *UserRepository

type User

type User struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Email     string             `json:"email" bson:"email"`
	Password  string             `json:"password" bson:"password"`
	Firstname string             `json:"firstname" bson:"firstname"`
	Lastname  string             `json:"lastname" bson:"lastname"`
}

type UserRepository

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

func (*UserRepository) GetOneUser

func (r *UserRepository) GetOneUser() (*User, error)

func (*UserRepository) GetUser

func (r *UserRepository) GetUser(ctx context.Context, args struct{ ID primitive.ObjectID }) (*User, error)

func (*UserRepository) GetUserByEmail

func (r *UserRepository) GetUserByEmail(ctx context.Context, email string) (*User, error)

func (*UserRepository) SaveUser

func (r *UserRepository) SaveUser(user User) (*primitive.ObjectID, error)

Jump to

Keyboard shortcuts

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