🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

vimagination.zapto.org/pages

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vimagination.zapto.org/pages

Go Modules
Version
v0.0.0-20250911063658-f1bcb923c878
Version published
Created
Source

pages

-- import "vimagination.zapto.org/pages"

Usage

const (
	Static         = "-static-"
	StaticTemplate = "{{define \"title\"}}{{.Title}}{{end}}{{define \"style\"}}{{.Style}}{{end}}{{define \"body\"}}\n{{.Body}}{{end}}"
)
var (
	ErrTemplateExists  = errors.New("template already exists")
	ErrUnknownTemplate = errors.New("unknown template")
)

Errors

type Bytes

type Bytes struct {
}

func (*Bytes) ServeHTTP

func (b *Bytes) ServeHTTP(w http.ResponseWriter, r *http.Request)

type File

type File struct {
	Filename string

	LastModified time.Time
}

func (*File) ServeHTTP

func (f *File) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HookFn

type HookFn func(http.ResponseWriter, *http.Request, interface{}) interface{}
var PassthroughHook HookFn = func(_ http.ResponseWriter, _ *http.Request, data interface{}) interface{} {
	return data
}

type Pages

type Pages struct {
}

func New

func New(baseTemplateFilename string) (*Pages, error)

func NewString

func NewString(baseTemplate string) (*Pages, error)

func (*Pages) Bytes

func (p *Pages) Bytes(title, style string, body template.HTML) *Bytes

func (*Pages) File

func (p *Pages) File(title, style, filename string) *File

func (*Pages) Hook

func (p *Pages) Hook(hook HookFn)

func (*Pages) Rebuild

func (p *Pages) Rebuild() error

func (*Pages) RegisterFile

func (p *Pages) RegisterFile(name, filename string) error

func (*Pages) RegisterString

func (p *Pages) RegisterString(name, contents string) error

func (*Pages) StaticFile

func (p *Pages) StaticFile(static string) error

func (*Pages) StaticString

func (p *Pages) StaticString(static string) error

func (*Pages) Write

func (p *Pages) Write(w http.ResponseWriter, r *http.Request, templateName string, data interface{}) error

FAQs

Package last updated on 11 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts