config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPassword = "HTTPSERVE_PASSWORD"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host              string
	Port              int
	Directory         string
	Allow             []string
	Password          string
	PasswordFile      string
	ShowHidden        bool
	OpenBrowser       bool
	Quiet             bool
	Version           bool
	Upload            bool
	QR                bool
	LogFormat         string
	MaxPreviewBytes   int64
	MaxUploadBytes    int64
	ReadTimeout       time.Duration
	ReadHeaderTimeout time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
	ShutdownTimeout   time.Duration
}

func Default

func Default() Config

func Parse

func Parse(args []string) (Config, error)

func ParseWithSources

func ParseWithSources(args []string, lookupEnv func(string) (string, bool), readFile func(string) ([]byte, error), output io.Writer) (Config, error)

func (Config) Addr

func (c Config) Addr() string

func (Config) DisplayURL

func (c Config) DisplayURL() string

Jump to

Keyboard shortcuts

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