示例#1
0
文件: http_lb.go 项目: kapalhq/envoy
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
0
func NewModMock(params params.ModuleParams) *ModMock {
	return &ModMock{
		optional1: params.GetStringOrDefault("optional1", ""),
		optional2: params.GetStringOrDefault("optional2", ""),
	}
}
示例#3
0
文件: exec.go 项目: kapalhq/envoy
func NewExec(params params.ModuleParams) *Exec {
	return &Exec{
		command: params.GetString("command"),
	}
}
示例#4
0
文件: access.go 项目: kapalhq/envoy
func NewAccess2(params params.ModuleParams) *Access {
	return build(params.GetStringArray("allow", ","), params.GetStringArray("deny", ","))
}
示例#5
0
文件: access.go 项目: kapalhq/envoy
func NewAccess(params params.ModuleParams) *Access {
	return &Access{
		Allow: params.GetArrayOrDefault("allow", []string{""}),
		Deny:  params.GetArrayOrDefault("deny", []string{"*"}),
	}
}
示例#6
0
文件: rewrite.go 项目: kapalhq/envoy
func NewRewrite(params params.ModuleParams) *Rewrite {
	return &Rewrite{
		path: params.GetArray("path"),
	}
}
示例#7
0
func NewBasicAuth(params params.ModuleParams) *BasicAuth {
	return &BasicAuth{
		username: params.GetString("username"),
		password: params.GetString("password"),
	}
}
示例#8
0
文件: docker.go 项目: kapalhq/envoy
func NewDocker(params params.ModuleParams) *ModDocker {
	return &ModDocker{
		socket: params.GetStringOrDefault("socket", "unix:///var/run/docker.sock"),
	}
}