spa

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

The spa package is experimental. The API will most likely change

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FsReader

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

func (*FsReader) Read

func (r *FsReader) Read(filename string) (b []byte, ok bool, err error)

type Handler

type Handler struct {
	IndexFile        string
	IndexTemplate    *template.Template
	IndexDataFn      IndexDataFn
	IndexRoute       string
	IndexCacheHeader string
	AssetFS          fs.FS
	AssetFSPrefix    string
	AssetPrefixes    []string
	AssetCacheHeader string

	NotFoundPrefixes []string
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(opts *HandlerOpts) *Handler

func (*Handler) ServeHTTP

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

type HandlerOpts

type HandlerOpts struct {
	IndexFile           string
	IndexFileIsTemplate bool
	IndexDataFn         IndexDataFn
	IndexRoute          string
	IndexCacheHeader    string
	AssetFS             fs.FS
	AssetFSPrefix       string
	AssetPrefixes       []string
	AssetCacheHeader    string
	NotFoundPrefixes    []string
}

type IndexDataFn added in v0.7.0

type IndexDataFn func(r *http.Request) (any, error)

type Reader

type Reader interface {
	Read(filename string) (b []byte, ok bool, err error)
}

Jump to

Keyboard shortcuts

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