fileserver

package module
v2.14.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 8 Imported by: 1

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	// Prefix HTTP
	Prefix string `mapstructure:"prefix"`

	// Dir contains name of directory to control access to.
	// Default - "."
	Root string `mapstructure:"root"`

	BytesRange    bool `mapstructure:"bytes_range"`
	Compress      bool `mapstructure:"compress"`
	CacheDuration int  `mapstructure:"cache_duration"`
	MaxAge        int  `mapstructure:"max_age"`
}

type Config

type Config struct {
	// Address to serve
	Address string `mapstructure:"address"`

	// CalculateEtag can be true/false and used to calculate etag for the static
	CalculateEtag bool `mapstructure:"calculate_etag"`

	// Weak etag `W/`
	Weak bool `mapstructure:"weak"`

	// per-root configuration
	Configuration []*Cfg `mapstructure:"serve"`

	// StreamRequestBody ...
	StreamRequestBody bool `mapstructure:"stream_request_body"`
}

func (*Config) Valid

func (c *Config) Valid() error

type Plugin

type Plugin struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

Jump to

Keyboard shortcuts

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