modules

package
v0.0.0-...-dafc34e Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package modules includes all base HTML layouts that will be used for rendering all pages in the application.

Index

Constants

This section is empty.

Variables

View Source
var ErrMustImplementPageConfig = errors.New("the passed data is required to implement PageConfig")

ErrMustImplementPageConfig is returned when the passed data does not implement the PageConfig interface.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	Layout string // template name of the base layout
	Title  string // title for the page
}

BaseConfig is a utility struct that can be embedded in other structs to implement the PageData interface.

func (BaseConfig) PageLayout

func (b BaseConfig) PageLayout() string

func (BaseConfig) PageTitle

func (b BaseConfig) PageTitle() string

type PageConfig

type PageConfig interface {
	PageLayout() string
	PageTitle() string
}

PageConfig is the data that will be passed to the template.

type View

type View interface {
	Hook(g *echo.Group) error
}

type ViewRenderer

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

ViewRenderer is the renderer for the main view.

func NewViewRenderer

func NewViewRenderer(livereload bool) *ViewRenderer

func (*ViewRenderer) Render

func (vr *ViewRenderer) Render(w io.Writer, name string, data any, c echo.Context) error

Render renders a template document.

Directories

Path Synopsis
Package accounts contains views for the accounts module.
Package accounts contains views for the accounts module.
Package home contains views for the pos module.
Package home contains views for the pos module.
Package pos contains views for the pos module.
Package pos contains views for the pos module.

Jump to

Keyboard shortcuts

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