webapp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

package webapp provides shared functionality for building web applications on top of the ikuzo APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStaticHandler

func NewStaticHandler(files fs.FS) http.HandlerFunc

NewStaticHandler receives an fs.FS (like embed.FS) and returns a http.HandlerFunc. The main purpose of this handler is to support embed.Fs static files with proper cache control. Without this wrapper the static content is never cached.

Types

type StaticFSWrapper

type StaticFSWrapper struct {
	http.FileSystem
	FixedModTime time.Time
}

func (*StaticFSWrapper) Open

func (f *StaticFSWrapper) Open(name string) (http.File, error)

type StaticFileInfoWrapper

type StaticFileInfoWrapper struct {
	os.FileInfo
	// contains filtered or unexported fields
}

func (*StaticFileInfoWrapper) ModTime

func (f *StaticFileInfoWrapper) ModTime() time.Time

type StaticFileWrapper

type StaticFileWrapper struct {
	http.File
	// contains filtered or unexported fields
}

func (*StaticFileWrapper) Stat

func (f *StaticFileWrapper) Stat() (os.FileInfo, error)

Jump to

Keyboard shortcuts

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