form

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Caddy2LogFormatReplacer = strings.NewReplacer(
	`{method} {uri} {proto}`, `{request>method} {request>uri} {request>proto}`,
	`{remote}`, `{request>remote_ip}`,
	`{user}`, `{request>user_id}`,
	`{when}`, `{ts}`,
	`{method}`, `{request>method}`,

	`{uri}`, `{request>uri}`,
	`{proto}`, `{request>proto}`,

	`{>Referer}`, `{request>headers>Referer>[0]}`,
	`{>User-Agent}`, `{request>headers>User-Agent>[0]}`,
	`{latency}`, `{duration}`,
)

{remote} - {user} [{when}] "{method} {scheme} {host} {uri} {proto}" {status} {size} "{>Referer}" "{>User-Agent}" {latency}

View Source
var NginxLogFormatReplacer = strings.NewReplacer(

	`{method} {uri} {proto}`, `$request`,
	`{remote}`, `$remote_addr`,
	`{user}`, `$remote_user`,
	`{when}`, `$time_local`,
	`{method}`, `$request_method`,
	`{scheme}`, `$scheme`,
	`{host}`, `$http_host`,
	`{uri}`, `$request_uri`,
	`{proto}`, `$server_protocol`,
	`{status}`, `$status`,
	`{size}`, `$body_bytes_sent`,
	`{>Referer}`, `$http_referer`,
	`{>User-Agent}`, `$http_user_agent`,
	`{latency}`, `$request_time`,
)

{remote} - {user} [{when}] "{method} {scheme} {host} {uri} {proto}" {status} {size} "{>Referer}" "{>User-Agent}" {latency}

Functions

func AddCSlashesIngoreSlash

func AddCSlashesIngoreSlash(s string, b ...rune) string

func AsCaddy2LogFormat

func AsCaddy2LogFormat(value string) string

func AsNginxLogFormat

func AsNginxLogFormat(value string) string

func ExplodeCombinedLogFormat

func ExplodeCombinedLogFormat(value string) string

func ParseDuration

func ParseDuration(str string) time.Duration

func SplitBySpace

func SplitBySpace(value string, formatter ...func(string) string) []string

Types

type CertPath

type CertPath struct {
	Cert   string
	Key    string
	Trust  string
	Domain string
}

type Item

type Item struct {
	Key  interface{}
	Val  interface{}
	Args []interface{}
}

type LocationDef

type LocationDef struct {
	PathKey  string
	Module   string
	Location string
	IsRegexp bool
	Items    []*Item
}

type Locations

type Locations struct {
	SortedStaticPath []string
	SortedRegexpPath []string
	GroupByPath      map[string][]*LocationDef
}

type NginxDomainInfo

type NginxDomainInfo struct {
	Port      int
	Args      []string
	Domains   []string
	CertsPath []*CertPath
}

type SortByLen

type SortByLen []string

func (SortByLen) Len

func (s SortByLen) Len() int

func (SortByLen) Less

func (s SortByLen) Less(i, j int) bool

func (SortByLen) Swap

func (s SortByLen) Swap(i, j int)

type UpstreamInfo

type UpstreamInfo struct {
	Scheme       string
	Host         string
	Path         string
	UpstreamName string
	Rewrite      string // rewrite ^/user/(.*)$ /$1 break;
	// contains filtered or unexported fields
}

func (UpstreamInfo) String

func (u UpstreamInfo) String() string

type Values

type Values struct {
	url.Values
	Config engine.Configer
}

func NewValues

func NewValues(values url.Values, cfg engine.Configer) *Values

func (Values) AddExtWildcardPrefix

func (v Values) AddExtWildcardPrefix(path string) string

添加扩展名通配符前缀

func (Values) AddPathWildcardSuffix

func (v Values) AddPathWildcardSuffix(path string) string

添加路径通配符后缀

func (Values) AddSlashes

func (v Values) AddSlashes(val string) string

func (Values) AddSlashesSingleQuote

func (v Values) AddSlashesSingleQuote(val string) string

func (Values) AddonAttr

func (v Values) AddonAttr(addon string, item string, defaults ...string) string

func (Values) AddonAttrFullKey

func (v Values) AddonAttrFullKey(fullKey string, item string, defaults ...string) string

func (Values) AsCaddy2LogFormat

func (v Values) AsCaddy2LogFormat() string

func (Values) AsDuration

func (v Values) AsDuration(str string) time.Duration

func (Values) AsNginxLogFormat

func (v Values) AsNginxLogFormat() string

func (Values) BCrypt

func (v Values) BCrypt(password string) string

func (Values) ExtensionsToMime

func (v Values) ExtensionsToMime(value string) []string

func (Values) GetAttrVal

func (v Values) GetAttrVal(addon string, item string, defaults ...string) string

func (Values) GetCerts

func (v Values) GetCerts(domains []string) []*CertPath

func (Values) GetDomainList

func (v Values) GetDomainList() []string

func (Values) GetKVData

func (v Values) GetKVData(addon string, itemOr ...string) *echo.KVData

func (Values) GetKVList

func (v Values) GetKVList(addon string, itemOr ...string) []echo.KV

func (Values) GetNginxDomainList

func (v Values) GetNginxDomainList() []NginxDomainInfo

func (Values) GetSlice

func (v Values) GetSlice(key string) param.StringSlice

func (Values) GetValueList

func (v Values) GetValueList(addon string, itemOr ...string) []string

func (Values) GetWebdavGlobal

func (v Values) GetWebdavGlobal() []*webdav.WebdavPerm

func (Values) GetWebdavUser

func (v Values) GetWebdavUser() []*webdav.WebdavUser

func (Values) GroupByLocations

func (v Values) GroupByLocations(fields []string) Locations

func (Values) IsEnabled

func (v Values) IsEnabled(key string, expectedValue ...string) bool

func (Values) Iterator

func (v Values) Iterator(addon string, item string, prefix string, withQuotes ...bool) interface{}

func (Values) IteratorHeaderKV

func (v Values) IteratorHeaderKV(addon string, item string, plusPrefix string, minusPrefix string, withValueAndQuotes ...bool) interface{}

func (Values) IteratorKV

func (v Values) IteratorKV(addon string, item string, prefix string, withQuotes ...bool) interface{}

func (Values) IteratorNginxProxyHeaderKV

func (v Values) IteratorNginxProxyHeaderKV() interface{}

func (Values) NginxLimitRateWithUnit added in v1.4.9

func (v Values) NginxLimitRateWithUnit() string

func (Values) NginxLocations

func (v Values) NginxLocations() Locations

func (Values) RegexpQuote

func (v Values) RegexpQuote(content string) string

func (Values) ServerGroup

func (v Values) ServerGroup(key string, customHost string, withQuotes ...bool) interface{}

func (Values) SliceAddExtWildcardPrefix

func (v Values) SliceAddExtWildcardPrefix(content []string) []string

func (Values) SliceAddPathWildcardSuffix

func (v Values) SliceAddPathWildcardSuffix(content []string) []string

func (Values) SliceRegexpQuote

func (v Values) SliceRegexpQuote(content []string) []string

func (Values) SplitBySpace

func (v Values) SplitBySpace(content string) []string

func (Values) SplitBySpaceWithExtWildcardPrefix

func (v Values) SplitBySpaceWithExtWildcardPrefix(content string) []string

func (Values) SplitBySpaceWithPathWildcardSuffix

func (v Values) SplitBySpaceWithPathWildcardSuffix(content string) []string

func (Values) SplitBySpaceWithPrefixAndSuffix

func (v Values) SplitBySpaceWithPrefixAndSuffix(content string, prefix string, suffix string) []string

func (Values) SplitBySpaceWithRegexpQuote

func (v Values) SplitBySpaceWithRegexpQuote(content string) []string

func (Values) VhostConfigDir

func (v Values) VhostConfigDir() string

Jump to

Keyboard shortcuts

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