param

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 11 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>...]

func TrimKVs added in v1.20.0

func TrimKVs(inputs [][2]string)

func TrimValuesAfterKey added in v1.20.0

func TrimValuesAfterKey(inputs [][]string)

TrimValuesAfterKey only trim values in [][key, value, value, ...]

Types

type Param

type Param struct {
	Root      string
	EmptyRoot bool

	PrefixUrls   []string
	AutoDirSlash int

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

	// [][username, password]
	UsersPlain  [][2]string
	UsersBase64 [][2]string
	UsersMd5    [][2]string
	UsersSha1   [][2]string
	UsersSha256 [][2]string
	UsersSha512 [][2]string

	GlobalAuth    bool
	AuthUrls      []string
	AuthUrlsUsers [][]string // [][path, user...]
	AuthDirs      []string
	AuthDirsUsers [][]string // [][path, user...]

	IndexUrls      []string
	IndexUrlsUsers [][]string // [][path, user...]
	IndexDirs      []string
	IndexDirsUsers [][]string // [][path, user...]

	GlobalUpload    bool
	UploadUrls      []string
	UploadUrlsUsers [][]string // [][path, user...]
	UploadDirs      []string
	UploadDirsUsers [][]string // [][path, user...]

	GlobalMkdir    bool
	MkdirUrls      []string
	MkdirUrlsUsers [][]string // [][path, user...]
	MkdirDirs      []string
	MkdirDirsUsers [][]string // [][path, user...]

	GlobalDelete    bool
	DeleteUrls      []string
	DeleteUrlsUsers [][]string // [][path, user...]
	DeleteDirs      []string
	DeleteDirsUsers [][]string // [][path, user...]

	GlobalArchive    bool
	ArchiveUrls      []string
	ArchiveUrlsUsers [][]string // [][path, user...]
	ArchiveDirs      []string
	ArchiveDirsUsers [][]string // [][path, user...]

	GlobalCors bool
	CorsUrls   []string
	CorsDirs   []string

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

	GlobalHeaders [][2]string // [][name, value]
	// [][path, name1, value1, ..., nameN, valueN]
	HeadersUrls [][]string
	HeadersDirs [][]string

	CertKeyPaths [][2]string
	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
	PostMiddlewares []middleware.Middleware
}

func (*Param) Normalize added in v1.19.0

func (param *Param) Normalize() (errs []error)

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