user

package
v0.0.0-...-3bb7120 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(h *Handler, router *anor.Router)

RegisterRoutes sets up the routing for the user-related endpoints. It maps HTTP methods and paths to their respective handler functions.

Types

type AddAddressForm

type AddAddressForm struct {
	Name          string
	AddressLine1  string
	AddressLine2  string
	City          string
	StateProvince string
	PostalCode    string
	Country       string
	DefaultFor    string
	SelectedAs    string
}

func (*AddAddressForm) Bind

func (f *AddAddressForm) Bind(r *http.Request) error

func (*AddAddressForm) Validate

func (f *AddAddressForm) Validate() error

type Handler

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

func NewHandler

func NewHandler(cfg *HandlerConfig) *Handler

func (*Handler) AddAddress

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

func (*Handler) Logout

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

func (*Handler) OrdersView

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

func (*Handler) ProfileView

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

func (*Handler) Render

func (h *Handler) Render(w http.ResponseWriter, r *http.Request, templatePath string, td templates.TemplateData)

type HandlerConfig

type HandlerConfig struct {
	UserService       anor.UserService
	OrderService      anor.OrderService
	AddressService    anor.AddressService
	Session           *session.Manager
	View              *html.View
	Logger            *slog.Logger
	Config            *config.Config
	GetHeaderDataFunc func(ctx context.Context) (header.Base, error)
}

Jump to

Keyboard shortcuts

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