users

package
v0.0.0-...-fbddd3b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(hashedPassword, password string) error

func Hash

func Hash(password string) (string, error)

func Santize

func Santize(data string) string

Types

type Controllers

type Controllers struct {
	Services Services
}

func (Controllers) Login

func (controllers Controllers) Login(c *gin.Context)

func (Controllers) Register

func (controllers Controllers) Register(c *gin.Context)

type ProfileResponse

type ProfileResponse struct {
	ID        uint    `json:"-"`
	Username  string  `json:"username"`
	Bio       string  `json:"bio"`
	Image     *string `json:"image"`
	Following bool    `json:"following"`
}

Declare your response schema here

type ProfileSerializer

type ProfileSerializer struct {
	C *gin.Context
	User
}

type Services

type Services struct {
	Client *mongo.Client
}

func (Services) RegisterUser

func (services Services) RegisterUser(username string, password string) (code int, message string)

func (Services) ValidateUser

func (services Services) ValidateUser(username string, password string) bool

type User

type User struct {
	Username string
	Password string
}

type UsersRouter

type UsersRouter struct {
	Services    Services
	Controllers Controllers
}

func (*UsersRouter) Init

func (router *UsersRouter) Init()

func (UsersRouter) Route

func (ur UsersRouter) Route(router *gin.RouterGroup)

Jump to

Keyboard shortcuts

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