fileserver

package module
v0.0.0-...-b8c4493 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FrontendPath = "./frontend" // should be set doing runtime by main.go
View Source
var Server = http.Server{
	Addr:              "",
	Handler:           nil,
	TLSConfig:         nil,
	ReadTimeout:       5 * time.Second,
	ReadHeaderTimeout: 20 * time.Second,
	WriteTimeout:      10 * time.Second,
	IdleTimeout:       0,
	MaxHeaderBytes:    0,
	TLSNextProto:      nil,
	ConnState:         nil,
	ErrorLog:          nil,
	BaseContext:       nil,
	ConnContext:       nil,
}
View Source
var ServerGraceShutdownTime = 5 * time.Second

Functions

func CreateChannel

func CreateChannel() (chan os.Signal, func())

func GetServerAddress

func GetServerAddress() string

func GracefulStart

func GracefulStart() error

func ServeFileServer

func ServeFileServer(response http.ResponseWriter, request *http.Request)

func SetServerAddress

func SetServerAddress(address string)

func Shutdown

func Shutdown(serverContext context.Context)

func Start

func Start() error

Types

type FileSystem

type FileSystem struct {
	FileSystem       http.FileSystem
	ReadDirBatchSize int // configuration parameter for `Readdir` func
}

func (FileSystem) Open

func (fileSystem FileSystem) Open(name string) (http.File, error)

type NeuteredStatFile

type NeuteredStatFile struct {
	http.File
	// contains filtered or unexported fields
}

func (NeuteredStatFile) Stat

func (neuteredStatFile NeuteredStatFile) Stat() (os.FileInfo, error)

Jump to

Keyboard shortcuts

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