static

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package static provides a simple static file middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Static added in v0.0.3

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

Static represents a static middleware.

func New

func New(root string) *Static

New creates a new static middleware.

func (*Static) Data added in v0.0.3

func (a *Static) Data(name string, data []byte, modtime time.Time) *Static

Data adds data to the middleware.

func (*Static) Dir added in v0.0.3

func (a *Static) Dir(dir string) *Static

Dir adds dir to the middleware.

func (*Static) FS added in v0.0.3

func (a *Static) FS(fsys fs.FS) *Static

FS adds fs to the middleware.

func (*Static) File added in v0.0.3

func (a *Static) File(name string, file fs.File) *Static

File adds file to the middleware.

func (*Static) Serve added in v0.0.3

func (a *Static) Serve(ctx *ws.Context) error

Serve serves the static files.

Jump to

Keyboard shortcuts

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