param

package
v1.15.15 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsToCmdResults added in v1.15.2

func ArgsToCmdResults(cmd *goNixArgParser.Command, args []string) (results []*goNixArgParser.ParseResult, printVersion, printHelp bool, errs []error)

func EntriesToKVs added in v1.15.3

func EntriesToKVs(entries []string) [][2]string

EntriesToKVs input element: "key:value" output element: [2]string{"key, "value"}

func NewCliCmd added in v1.15.2

func NewCliCmd() *goNixArgParser.Command

func NormalizeFsPaths added in v1.15.3

func NormalizeFsPaths(inputs []string) []string

func NormalizeRedirectCode added in v1.15.3

func NormalizeRedirectCode(code int) int

func NormalizeUrlPaths added in v1.15.3

func NormalizeUrlPaths(inputs []string) []string

func PrintHelp added in v1.15.1

func PrintHelp()

func SplitAllKeyValue added in v1.15.3

func SplitAllKeyValue(inputs []string) (results [][2]string)

func SplitAllKeyValues added in v1.15.3

func SplitAllKeyValues(inputs []string) (results [][]string)

func SplitKeyValue added in v1.15.3

func SplitKeyValue(input string) (k, v string, ok bool)

SplitKeyValue input format: <sep><key><sep><value>

func SplitKeyValues added in v1.15.3

func SplitKeyValues(input string) (key string, values []string, ok bool)

SplitKeyValues input format: <sep><key>[<sep><value>...]

Types

type Param

type Param struct {
	Root      string
	EmptyRoot bool

	PrefixUrls    []string
	ForceDirSlash int

	DefaultSort string
	DirIndexes  []string
	// value: [url-path, fs-path]
	Aliases [][2]string

	GlobalRestrictAccess []string
	// value: [restrict-path, allow-hosts...]
	RestrictAccessUrls [][]string
	RestrictAccessDirs [][]string

	// value: [name, value]
	GlobalHeaders [][2]string
	// value: [path, (name, value)...]
	HeadersUrls [][]string
	HeadersDirs [][]string

	GlobalUpload bool
	UploadUrls   []string
	UploadDirs   []string

	GlobalMkdir bool
	MkdirUrls   []string
	MkdirDirs   []string

	GlobalDelete bool
	DeleteUrls   []string
	DeleteDirs   []string

	GlobalArchive bool
	ArchiveUrls   []string
	ArchiveDirs   []string

	GlobalCors bool
	CorsUrls   []string
	CorsDirs   []string

	GlobalAuth bool
	AuthUrls   []string
	AuthDirs   []string
	// value: [username, password]
	UsersPlain    [][2]string
	UsersBase64   [][2]string
	UsersMd5      [][2]string
	UsersSha1     [][2]string
	UsersSha256   [][2]string
	UsersSha512   [][2]string
	UserMatchCase bool

	Certificates []tls.Certificate
	Listens      []string
	ListensPlain []string
	ListensTLS   []string
	HostNames    []string
	Theme        string
	ThemeDir     string

	Hsts        bool
	HstsMaxAge  int
	ToHttps     bool
	ToHttpsPort string

	Shows     []string
	ShowDirs  []string
	ShowFiles []string
	Hides     []string
	HideDirs  []string
	HideFiles []string

	AccessLog string
	ErrorLog  string

	PreMiddlewares  []middleware.Middleware
	InMiddlewares   []middleware.Middleware
	PostMiddlewares []middleware.Middleware
}

type Params added in v1.15.2

type Params []*Param

func CmdResultsToParams added in v1.15.2

func CmdResultsToParams(results []*goNixArgParser.ParseResult) (params Params, errs []error)

func NewParams added in v1.15.2

func NewParams(paramList []Param) (params Params, errs []error)

func ParseFromCli added in v1.15.1

func ParseFromCli() (params Params, printVersion, printHelp bool, errs []error)

Jump to

Keyboard shortcuts

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