static

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEtag

func GenerateEtag(info fs.FileInfo, weak bool) string

Types

type FileServer

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

func NewFileServer

func NewFileServer(options *Options) *FileServer

func (*FileServer) Serve

func (instance *FileServer) Serve(
	request httpcontract.Request,
	logger loggingcontract.Logger,
) (int, nethttp.Header, []byte, bool)

func (*FileServer) ServeReader

func (instance *FileServer) ServeReader(
	request httpcontract.Request,
	logger loggingcontract.Logger,
) (int, nethttp.Header, io.ReadCloser, bool)

type FileServerConfig

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

func NewFileServerConfig

func NewFileServerConfig(
	mode Mode,
	publicDir string,
	indexFile string,
	stripPrefix string,
	enableCache bool,
	cacheMaxAge int,
	weakEtag bool,
) *FileServerConfig

type Mode

type Mode string
const (
	ModeFilesystem Mode = "filesystem"
	ModeEmbedded   Mode = "embedded"
)

type Options

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

func NewOptions

func NewOptions(
	fileServerConfig *FileServerConfig,
	root string,
	fileSystem fs.FS,
) *Options

Jump to

Keyboard shortcuts

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