server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS
View Source
var TemplatesFS embed.FS

Functions

func BuildURL added in v0.5.0

func BuildURL(r *http.Request, fragments ...string) *url.URL

func CleanTempFile

func CleanTempFile(file *os.File)

func SanitizeFilename

func SanitizeFilename(filename string) string

func ShowInline

func ShowInline(contentType string) bool

func ValidateContentType

func ValidateContentType(h http.Header) bool

Types

type OptionFn

type OptionFn func(*Server)

func MaxRequests added in v0.5.0

func MaxRequests(requests int) OptionFn

func MaxUploadSize

func MaxUploadSize(kbytes int64) OptionFn

func Port

func Port(port int) OptionFn

func UseLogger added in v0.5.0

func UseLogger(logger *logger.Logger) OptionFn

func UseStorage

func UseStorage(storage storage.Storage) OptionFn

type Server

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

func New

func New(options ...OptionFn) *Server

func (*Server) Run

func (s *Server) Run()

Jump to

Keyboard shortcuts

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