user

package
v0.0.0-...-4e6ff53 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginUserDto

type LoginUserDto struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Service

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

func NewService

func NewService(storage Storage, logger *logging.Logger) *Service

func (Service) FindUser

func (s Service) FindUser(ctx context.Context, username string, password string) (id string, err error)

type Storage

type Storage interface {
	FindByName(ctx context.Context, username string) (User, error)
}

func NewMongoStorage

func NewMongoStorage(database *mongo.Database, collection string, logger *logging.Logger) Storage

type User

type User struct {
	Id           string `json:"id" bson:"_id"`
	Username     string `json:"username" bson:"username"`
	PasswordHash string `json:"passwordHash" bson:"passwordHash"`
}

Jump to

Keyboard shortcuts

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