web

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page string
const (
	NotFound Page = "404"
)

type PageRenderer

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

func (*PageRenderer) Render

func (p *PageRenderer) Render(w http.ResponseWriter, r *http.Request, page Page, opts ...RenderOption)

type RenderOption

type RenderOption func(*PageRenderer) error

func WithOriginalURL

func WithOriginalURL(val string) RenderOption

func WithShortURL

func WithShortURL(val string) RenderOption

func WithTTL

func WithTTL(val time.Duration) RenderOption

type Renderer

type Renderer interface {
	Render(http.ResponseWriter, *http.Request, Page, ...RenderOption)
}

func New

func New() Renderer

Jump to

Keyboard shortcuts

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