Help us shape the future of Go! Take the 2026 Go Developer Survey

fileserver

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RootPath specifies the filesystem path from which requests are to be served.
	RootPath string
}

type FileserverService

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

func New

func New() *FileserverService

New initialises an unconfigured fileserver. See [Configure] for details.

func NewWithConfig

func NewWithConfig(config *Config) *FileserverService

New initialises and optionally configures a fileserver. See [Service.Configure] for details.

func (*FileserverService) Configure

func (s *FileserverService) Configure(config *Config)

Configure reconfigures the fileserver. If config is nil, then every request will receive a 503 Service Unavailable response.

func (*FileserverService) ServeHTTP

func (s *FileserverService) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*FileserverService) ServiceName

func (s *FileserverService) ServiceName() string

ServiceName returns the name of the plugin. You should use the go module format e.g. github.com/myuser/myplugin

Jump to

Keyboard shortcuts

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