html

package
v0.0.0-...-f261bde Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PrettyRender bool `mapstructure:"prettyRender"`
	HotReload    bool `mapstructure:"hotReload"`
}

type MockWriter

type MockWriter struct {
	mock.Mock
}

MockWriter is an autogenerated mock type for the Writer type

func NewMockWriter

func NewMockWriter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockWriter

NewMockWriter creates a new instance of MockWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockWriter) WriteHTMLErrorPage

func (_m *MockWriter) WriteHTMLErrorPage(w http.ResponseWriter, r *http.Request, err error)

WriteHTMLErrorPage provides a mock function with given fields: w, r, err

func (*MockWriter) WriteHTMLTemplate

func (_m *MockWriter) WriteHTMLTemplate(w http.ResponseWriter, r *http.Request, status int, template Templater)

WriteHTMLTemplate provides a mock function with given fields: w, r, status, template

type Renderer

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

func NewRenderer

func NewRenderer(cfg Config) *Renderer

func (*Renderer) WriteHTMLErrorPage

func (t *Renderer) WriteHTMLErrorPage(w http.ResponseWriter, r *http.Request, err error)

func (*Renderer) WriteHTMLTemplate

func (t *Renderer) WriteHTMLTemplate(w http.ResponseWriter, r *http.Request, status int, template Templater)

type Templater

type Templater interface {
	Template() string
}

type Writer

type Writer interface {
	WriteHTMLTemplate(w http.ResponseWriter, r *http.Request, status int, template Templater)
	WriteHTMLErrorPage(w http.ResponseWriter, r *http.Request, err error)
}

Directories

Path Synopsis
templates

Jump to

Keyboard shortcuts

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