users

package
v0.0.0-...-bab95bc Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(user *User) (string, error)

Types

type LoggedInUser

type LoggedInUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Token    string `json:"token"`
}

type User

type User struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password,omitempty"`
}

type UserLogin

type UserLogin struct {
	User User `json:"user"`
}

type UserLoginHandler

type UserLoginHandler struct {
	Path           string
	UserRepository UserRepository
}

func (*UserLoginHandler) Login

func (u *UserLoginHandler) Login(writer http.ResponseWriter, request *http.Request)

type UserNeo4jRepository

type UserNeo4jRepository struct {
	Driver neo4j.Driver
}

func (*UserNeo4jRepository) FindByEmailAndPassword

func (u *UserNeo4jRepository) FindByEmailAndPassword(email string, password string) (user *User, err error)

func (*UserNeo4jRepository) RegisterUser

func (u *UserNeo4jRepository) RegisterUser(user *User) (err error)

type UserRegistration

type UserRegistration struct {
	User User `json:"user"`
}

type UserRegistrationHandler

type UserRegistrationHandler struct {
	Path           string
	UserRepository UserRepository
}

func (*UserRegistrationHandler) Register

func (u *UserRegistrationHandler) Register(writer http.ResponseWriter, request *http.Request)

type UserRepository

type UserRepository interface {
	RegisterUser(user *User) error
	FindByEmailAndPassword(email string, password string) (*User, error)
}

Jump to

Keyboard shortcuts

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