本文整理匯總了Golang中github.com/kapalhq/envoy/modules/params.ModuleParams類的典型用法代碼示例。如果您正苦於以下問題:Golang ModuleParams類的具體用法?Golang ModuleParams怎麽用?Golang ModuleParams使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ModuleParams類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewHttpLoadbalancer
func NewHttpLoadbalancer(params params.ModuleParams) *HttpLoadbalancer {
strategyParsed := sanitizePolicy(params.GetStringOrDefault("strategy", ROUND_ROBIN_STRATEGY))
urlParsed := mustParseUrl(params.GetString("url"))
return &HttpLoadbalancer{
strategy: strategyParsed,
url: urlParsed,
}
}
示例2: NewModMock
func NewModMock(params params.ModuleParams) *ModMock {
return &ModMock{
optional1: params.GetStringOrDefault("optional1", ""),
optional2: params.GetStringOrDefault("optional2", ""),
}
}
示例3: NewExec
func NewExec(params params.ModuleParams) *Exec {
return &Exec{
command: params.GetString("command"),
}
}
示例4: NewAccess2
func NewAccess2(params params.ModuleParams) *Access {
return build(params.GetStringArray("allow", ","), params.GetStringArray("deny", ","))
}
示例5: NewAccess
func NewAccess(params params.ModuleParams) *Access {
return &Access{
Allow: params.GetArrayOrDefault("allow", []string{""}),
Deny: params.GetArrayOrDefault("deny", []string{"*"}),
}
}
示例6: NewRewrite
func NewRewrite(params params.ModuleParams) *Rewrite {
return &Rewrite{
path: params.GetArray("path"),
}
}
示例7: NewBasicAuth
func NewBasicAuth(params params.ModuleParams) *BasicAuth {
return &BasicAuth{
username: params.GetString("username"),
password: params.GetString("password"),
}
}
示例8: NewDocker
func NewDocker(params params.ModuleParams) *ModDocker {
return &ModDocker{
socket: params.GetStringOrDefault("socket", "unix:///var/run/docker.sock"),
}
}