sws

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigOption added in v0.0.2

type ConfigOption func(c *config)

func SetCSP added in v0.0.2

func SetHashedFilenameCachePolicy

func SetHashedFilenameCachePolicy() ConfigOption

func SetIndexFileName added in v0.0.2

func SetIndexFileName(indexFileName string) ConfigOption

func SetNotFoundFile

func SetNotFoundFile(fileName string, statusCode int) ConfigOption

func SetNotFoundHandler added in v0.0.2

func SetNotFoundHandler(notFoundHandler http.Handler) ConfigOption

type ContentSecurityPolicy added in v0.0.2

type ContentSecurityPolicy struct {
	Default []string
	Script  []string
	Image   []string
	Connect []string
	Frame   []string
}

func (ContentSecurityPolicy) String added in v0.0.2

func (csp ContentSecurityPolicy) String() string

type Service

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

func New

func New(
	httpFileSystem http.FileSystem,
	opts ...ConfigOption,
) *Service

func NewSPA added in v0.0.2

func NewSPA(
	httpFileSystem http.FileSystem,
	indexFileName string,
	csp ContentSecurityPolicy,
) *Service

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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