server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 25 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 SitePasswordMiddleware added in v0.7.0

func SitePasswordMiddleware(sitePasswordHash string) func(http.Handler) http.Handler

func ValidateContentType

func ValidateContentType(h http.Header) bool

Types

type OptionFn

type OptionFn func(*Server)

func ExtraFooterText added in v0.7.0

func ExtraFooterText(text string) OptionFn

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 Sentry added in v0.7.0

func Sentry(sentryDSN, sentryEnvironment string) OptionFn

func SitePassword added in v0.7.0

func SitePassword(password string) 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