auth

package
v0.0.0-...-7f3334f Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Register(User) error
	Login(User) (interface{}, error)
	Logout() error
	IsAuthenticated() error
	GetUser(string) (interface{}, error)
}

type Service

type Service interface {
	Register(User) error
	Login(User) (interface{}, error)
	Logout() error
	IsAuthenticated() error
	GetUser(string) (interface{}, error)
}

func NewService

func NewService(r Repository) Service

type User

type User struct {
	FirstName string `bson:"firstName" json:"firstName"`
	LastName  string `bson:"lastName" json:"lastName"`
	Email     string `bson:"email" json:"email"  binding:"required"`
	Password  string `bson:"password" json:"password" binding:"required"`
}

Jump to

Keyboard shortcuts

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