users

package
v0.0.0-...-cff06d4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewUsersService

func NewUsersService(db *mongo.Database, log *logrus.Logger) *Service

func (*Service) CreateUser

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

func (*Service) DeleteUser

func (s *Service) DeleteUser(ctx context.Context, userID string) (*User, error)

func (*Service) GetUser

func (s *Service) GetUser(ctx context.Context, userID string) (*User, error)

func (*Service) GetUserByEmail

func (s *Service) GetUserByEmail(ctx context.Context, email string) (*User, error)

func (*Service) GetUsers

func (s *Service) GetUsers(ctx context.Context, lastID string, limit int) ([]User, error)

func (*Service) LoginUser

func (s *Service) LoginUser(ctx context.Context, email, password string) (*User, string, error)

type User

type User struct {
	ID          string    `json:"id" bson:"_id,omitempty"`
	FirstName   string    `json:"firstName" bson:"firstName,omitempty"`
	LastName    string    `json:"lastName" bson:"lastName,omitempty"`
	Email       string    `json:"email" bson:"email,omitempty"`
	Password    string    `json:"-" bson:"password,omitempty"`
	TimeAdded   time.Time `json:"timeAdded" bson:"timeAdded,omitempty"`
	LastUpdated time.Time `json:"-" bson:"lastUpdated,omitempty"`
}

Jump to

Keyboard shortcuts

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