server

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 GetUpload

func GetUpload(r *http.Request) (file io.Reader, filename, contentType string, contentLength int64, err error)

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