users

package
v0.0.0-...-24ccd8c Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 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 Store

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

Store struct manages interactions with users store

func New

func New(db *mongo.Client) *Store

New creates a new Store struct

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, user *domain.User) (*domain.User, error)

CreateUser method to save user in repository mongo

type User

type User struct {
	ID           string            `bson:"id,omitempty"`
	FirstName    string            `bson:"first_name,omitempty"`
	LastName     string            `bson:"last_name,omitempty"`
	Email        string            `bson:"email,omitempty"`
	Password     string            `bson:"password,omitempty"`
	SaltPassword string            `bson:"salt_password,omitempty"`
	Roles        []roleSchema.Role `bson:"roles,omitempty"`
	RoleID       []string          `bson:"roles_id"`
	Status       string            `bson:"status"`
	UpdatedAt    time.Time         `bson:"updated_at,omitempty"`
	CreatedAt    time.Time         `bson:"created_at,omitempty"`
	ActivedAt    time.Time         `bson:"actived_at,omitempty"`
}

User struct defines the database model

Jump to

Keyboard shortcuts

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