handlers

package
v0.0.0-...-04d6c90 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(w http.ResponseWriter, r *http.Request)

func Make

func Make(h APIFunc) http.HandlerFunc

func Register

func Register(w http.ResponseWriter, r *http.Request) error

Types

type APIError

type APIError struct {
	StatusCode int `json:"statusCode"`
	Msg        any `json:"msg"`
}

func InvalidJSON

func InvalidJSON() APIError

func InvalidRequestData

func InvalidRequestData(errors map[string]string) APIError

func NewAPIError

func NewAPIError(statusCode int, err error) APIError

func (APIError) Error

func (e APIError) Error() string

type APIFunc

type APIFunc func(w http.ResponseWriter, r *http.Request) error

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

type LoginCredentials

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

type RegisterFields

type RegisterFields struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
	FullName string `json:"full_name"`
}

Jump to

Keyboard shortcuts

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