static

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: BSD-3-Clause Imports: 7 Imported by: 15

README

go-http-static

Opinionated Go package for emebedding static assets and referencing resources in web applications.

Documentation

Documentation is incomplete at this time.

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendResourcesHandler

func AppendResourcesHandler(next http.Handler, opts *ResourcesOptions) http.Handler

func AppendResourcesHandlerWithPrefix

func AppendResourcesHandlerWithPrefix(next http.Handler, opts *ResourcesOptions, prefix string) http.Handler

func AppendStaticAssetHandlers

func AppendStaticAssetHandlers(mux *http.ServeMux, static_fs fs.FS) error

func AppendStaticAssetHandlersWithPrefix

func AppendStaticAssetHandlersWithPrefix(mux *http.ServeMux, static_fs fs.FS, prefix string) error

func StaticAssetsHandler

func StaticAssetsHandler(static_fs fs.FS) (http.Handler, error)

func StaticAssetsHandlerWithPrefix

func StaticAssetsHandlerWithPrefix(static_fs fs.FS, prefix string) (http.Handler, error)

Types

type ResourcesOptions

type ResourcesOptions struct {
	JS                    []string
	CSS                   []string
	DataAttributes        map[string]string
	AppendJavaScriptAtEOF bool
}

ResourcesOptions provides a list of JavaScript and CSS link to include with HTML output.

func DefaultResourcesOptions

func DefaultResourcesOptions() *ResourcesOptions

Return a *ResourcesOptions struct with default paths and URIs.

Jump to

Keyboard shortcuts

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