config

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config provides the necessary configurations for gofileserver.

The configurations can be retrieved from command line flags if needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BaseDir to serve.
	BaseDir string

	// Addr to listen.
	Addr string

	// HTTPS flag to enable HTTPS using SSLCertFile and SSLKeyFile.
	HTTPS bool

	// SSLCertFile refers to the location of SSL certificate.
	SSLCertFile string

	// SSLKeyFile refers to the location of SSL key.
	SSLKeyFile string

	// AllowCORS flag to allow requests from all origin.
	AllowCors bool
}

Config for the fileserver.

func New

func New() *Config

New returns a Config instance.

func (*Config) Fetch

func (conf *Config) Fetch() (err error)

Fetch configuration from command line flags.

Jump to

Keyboard shortcuts

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