controller

package
v0.0.0-...-694c729 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_FAILED_ATTEMPTS = 3
)

Variables

This section is empty.

Functions

func Health

func Verify

func VerifySessionToken

func VerifySessionToken(sr *SharedResources, w http.ResponseWriter, r *http.Request) error

Types

type Handler

type Handler struct {
	SharedResources *SharedResources
	Handler         func(sr *SharedResources, w http.ResponseWriter, r *http.Request) error
}

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

to satisfy http.Handler

type HandlerError

type HandlerError struct {
	Code    int
	Message string
	Err     error
}

func (HandlerError) Error

func (error HandlerError) Error() string

type LoginRequest

type LoginRequest struct {
	CredentialUuid string `json:"credential_uuid"`
	Email          string `json:"email"`
	Password       string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Jwt            string `json:"jwt"`
	SessionJwt     string `json:"session"`
	CredentialUuid string `json:"credential_uuid"`
}

type SharedResources

type SharedResources struct {
	DB  *sql.DB
	Env string
}

type TokenRequest

type TokenRequest struct {
	SessionJwt string `json:"session"`
}

type TokenResponse

type TokenResponse struct {
	Jwt string `json:"jwt"`
}

type VerifyRequest

type VerifyRequest struct {
	Jwt string `json:"jwt"`
}

type VerifyResponse

type VerifyResponse struct {
	Verified bool `json:"verified"`
}

type VerifySessionTokenRequest

type VerifySessionTokenRequest struct {
	SessionJwt string `json:"session"`
}

type VerifySessionTokenResponse

type VerifySessionTokenResponse struct {
	CredentialUuid string `json:"credential_uuid"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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