handler

package
v0.0.0-...-6d1ceae Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDisplayTime = time.RFC822

	// exported params
	ParamRecipeSlug     = "recipeSlug"
	ParamTagSlug        = "tagSlug"
	ParamIngredientSlug = "ingredientSlug"
	ParamEquipmentSlug  = "equipmentSlug"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AboutInstance

type AboutInstance struct {
	*CommonInstance
}

type CatalogInstance

type CatalogInstance struct {
	*CommonInstance
	Tags        []*recipe.Tag
	Ingredients []*recipe.Ingredient
	Equipment   []*recipe.Equipment
}

type CommonInstance

type CommonInstance struct {
	Env               string
	Domain            string
	Session           string
	Error             error
	Message           *string
	CurrentView       string
	Version           string
	GoogleAnalyticsID string
	CommentsID        string
	UI                *locale.UITranslation
	// contains filtered or unexported fields
}

func (*CommonInstance) CloseError

func (c *CommonInstance) CloseError()

func (*CommonInstance) CloseMessage

func (c *CommonInstance) CloseMessage()

func (*CommonInstance) Locale

func (c *CommonInstance) Locale() string

func (*CommonInstance) SetLocale

func (c *CommonInstance) SetLocale(l string)

type Constants

type Constants struct {
}

type EquipmentInstance

type EquipmentInstance struct {
	*CommonInstance
	Equipment    *recipe.Equipment
	Recipes      []*recipe.Recipe
	RecipesCount int
	Title        string
	Type         string
	Filter       recipe.Filter
}

type Handler

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

func NewHandler

func NewHandler(
	app *app.App,
	logger logger.Logger,
	t string,
) (*Handler, error)

func (*Handler) About

func (h *Handler) About() live.Handler

func (*Handler) Catalog

func (h *Handler) Catalog() live.Handler

func (*Handler) Equipment

func (h *Handler) Equipment() live.Handler

func (*Handler) HandleError

func (h *Handler) HandleError(ctx context.Context, err error)

func (*Handler) Home

func (h *Handler) Home() live.Handler

func (*Handler) Ingredient

func (h *Handler) Ingredient() live.Handler

func (*Handler) NewAboutInstance

func (h *Handler) NewAboutInstance(s live.Socket) *AboutInstance

func (*Handler) NewCatalogInstance

func (h *Handler) NewCatalogInstance(s live.Socket) *CatalogInstance

func (*Handler) NewCommon

func (h *Handler) NewCommon(s live.Socket, currentView string) *CommonInstance

func (*Handler) NewConstants

func (h *Handler) NewConstants() *Constants

func (*Handler) NewEquipmentInstance

func (h *Handler) NewEquipmentInstance(s live.Socket) *EquipmentInstance

func (*Handler) NewHomeInstance

func (h *Handler) NewHomeInstance(s live.Socket) *HomeInstance

func (*Handler) NewIngredientInstance

func (h *Handler) NewIngredientInstance(s live.Socket) *IngredientInstance

func (*Handler) NewNotFoundInstance

func (h *Handler) NewNotFoundInstance(s live.Socket) *NotFoundInstance

func (*Handler) NewPrivacyInstance

func (h *Handler) NewPrivacyInstance(s live.Socket) *PrivacyInstance

func (*Handler) NewRecipeInstance

func (h *Handler) NewRecipeInstance(s live.Socket) *RecipeInstance

func (*Handler) NewTagInstance

func (h *Handler) NewTagInstance(s live.Socket) *TagInstance

func (*Handler) NewTermsInstance

func (h *Handler) NewTermsInstance(s live.Socket) *TermsInstance

func (*Handler) NotFound

func (h *Handler) NotFound() live.Handler

func (*Handler) NotFoundRedirect

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

func (*Handler) Privacy

func (h *Handler) Privacy() live.Handler

func (*Handler) Recipe

func (h *Handler) Recipe() live.Handler

func (*Handler) RobotsHandler

func (h *Handler) RobotsHandler() http.HandlerFunc

func (*Handler) SitemapHandler

func (h *Handler) SitemapHandler() http.HandlerFunc

func (*Handler) Tag

func (h *Handler) Tag() live.Handler

func (*Handler) Terms

func (h *Handler) Terms() live.Handler

type HomeInstance

type HomeInstance struct {
	*CommonInstance
	Recipes       []*recipe.Recipe
	RecipesCount  int
	Tags          []*recipe.Tag
	TagGroups     []string
	SelectedGroup string
	FilteredTags  []*recipe.Tag
	Ingredients   []*recipe.Ingredient
	Equipment     []*recipe.Equipment
	Filter        recipe.Filter
	NewFirst      bool
	Pagination    Pagination
}

func (*HomeInstance) WithUpdateRecipes

func (ins *HomeInstance) WithUpdateRecipes(
	ctx context.Context,
	h *Handler,
	s live.Socket,
	resetOffset bool,
) (*HomeInstance, error)

type IngredientInstance

type IngredientInstance struct {
	*CommonInstance
	Ingredient   *recipe.Ingredient
	Recipes      []*recipe.Recipe
	RecipesCount int
	Type         string
	Title        string
	Filter       recipe.Filter
}

type NotFoundInstance

type NotFoundInstance struct {
	*CommonInstance
}

type Pagination

type Pagination struct {
	TotalPages  int
	CurrentPage int
	Pages       []int
}

type PrivacyInstance

type PrivacyInstance struct {
	*CommonInstance
}

type RecipeInstance

type RecipeInstance struct {
	*CommonInstance
	*Constants
	RecipeSlug     string
	Recipe         *recipe.Recipe
	ShowSimplified bool
}

type Sitemap

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

type SitemapURL

type SitemapURL struct {
	Loc        string `xml:"loc"`
	LastMod    string `xml:"lastmod,omitempty"`
	ChangeFreq string `xml:"changefreq,omitempty"`
	Priority   string `xml:"priority,omitempty"`
}

type TagInstance

type TagInstance struct {
	*CommonInstance
	Tag          *recipe.Tag
	Recipes      []*recipe.Recipe
	RecipesCount int
	Type         string
	Title        string
	Filter       recipe.Filter
}

type TermsInstance

type TermsInstance struct {
	*CommonInstance
}

Jump to

Keyboard shortcuts

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