handlers

package
v0.18.9 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessIsAuthName = "is_authenticated"
	SessUserID     = "user_id"
	SessUserEmail  = "user_email"
	SessIsAdmin    = "is_admin"
)

Variables

View Source
var AuthenticatedSessionName = fmt.Sprintf(
	"ua-%s-%s",
	config.Cfg.ProjectName,
	config.Cfg.Environment,
)

Functions

This section is empty.

Types

type Api

type Api struct{}

func (*Api) AppHealth

func (a *Api) AppHealth(ctx echo.Context) error

type App

type App struct {
	// contains filtered or unexported fields
}

func (*App) AboutPage

func (a *App) AboutPage(ctx echo.Context) error

func (*App) LandingPage

func (a *App) LandingPage(ctx echo.Context) error

type Authentication

type Authentication struct {
	// contains filtered or unexported fields
}

func (*Authentication) CreateAuthenticatedSession

func (a *Authentication) CreateAuthenticatedSession(ctx echo.Context) error

func (*Authentication) CreatePasswordReset

func (a *Authentication) CreatePasswordReset(ctx echo.Context) error

func (*Authentication) CreateResetPassword

func (a *Authentication) CreateResetPassword(ctx echo.Context) error

func (*Authentication) StoreAuthenticatedSession

func (a *Authentication) StoreAuthenticatedSession(ctx echo.Context) error

func (*Authentication) StorePasswordReset

func (a *Authentication) StorePasswordReset(ctx echo.Context) error

func (*Authentication) StoreResetPassword

func (a *Authentication) StoreResetPassword(ctx echo.Context) error

type Dashboard

type Dashboard struct{}

func (*Dashboard) Index

func (d *Dashboard) Index(ctx echo.Context) error

type FlashStorage

type FlashStorage struct {
	// contains filtered or unexported fields
}

func NewCookieStore

func NewCookieStore(sessionKey string) FlashStorage

func (FlashStorage) CreateFlashMsg

func (cs FlashStorage) CreateFlashMsg(
	r *http.Request,
	rw http.ResponseWriter,
	key string,
	args ...string,
) error

func (FlashStorage) GetFlashMessages

func (cs FlashStorage) GetFlashMessages(
	r *http.Request,
	rw http.ResponseWriter,
	key string,
) ([]string, error)

type Handlers

type Handlers struct {
	Api            Api
	App            App
	Authentication Authentication
	Dashboard      Dashboard
	Registration   Registration
}

func NewHandlers

func NewHandlers(
	db psql.Postgres,
	cache otter.CacheWithVariableTTL[string, string],
	authSvc services.Auth,
	emailSvc services.Email,
) Handlers

type PasswordResetTokenPayload

type PasswordResetTokenPayload struct {
	Token string `query:"token"`
}

type Registration

type Registration struct {
	// contains filtered or unexported fields
}

func (*Registration) CreateUser

func (r *Registration) CreateUser(ctx echo.Context) error

func (*Registration) StoreUser

func (r *Registration) StoreUser(ctx echo.Context) error

func (*Registration) VerifyUserEmail

func (r *Registration) VerifyUserEmail(ctx echo.Context) error

type ResetPasswordPayload

type ResetPasswordPayload struct {
	Password        string `form:"password"`
	ConfirmPassword string `form:"confirm_password"`
	Token           string `form:"token"`
}

type Resource added in v0.18.9

type Resource struct {
	// contains filtered or unexported fields
}

func (Resource) Sitemap added in v0.18.9

func (r Resource) Sitemap(c echo.Context) error

type Sitemap added in v0.18.9

type Sitemap struct {
	XMLName xml.Name `xml:"urlset"`
	XMLNS   string   `xml:"xmlns,attr"`
	URL     []URL    `xml:"url"`
}

type StoreAuthenticatedSessionPayload

type StoreAuthenticatedSessionPayload struct {
	Mail       string `form:"email"`
	Password   string `form:"password"`
	RememberMe string `form:"remember_me"`
}

type StorePasswordResetPayload

type StorePasswordResetPayload struct {
	Email string `form:"email"`
}

type StoreUserPayload

type StoreUserPayload struct {
	UserName        string `form:"username"`
	Email           string `form:"email"`
	Password        string `form:"password"`
	ConfirmPassword string `form:"confirm_password"`
}

type URL added in v0.18.9

type URL struct {
	XMLName    xml.Name `xml:"url"`
	Loc        string   `xml:"loc"`
	ChangeFreq string   `xml:"changefreq"`
	LastMod    string   `xml:"lastmod"`
	Priority   string   `xml:"priority"`
}

Jump to

Keyboard shortcuts

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