fileserver

package
v3.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 2 Imported by: 0

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