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, } }
func NewModMock(params params.ModuleParams) *ModMock { return &ModMock{ optional1: params.GetStringOrDefault("optional1", ""), optional2: params.GetStringOrDefault("optional2", ""), } }
func NewExec(params params.ModuleParams) *Exec { return &Exec{ command: params.GetString("command"), } }
func NewAccess2(params params.ModuleParams) *Access { return build(params.GetStringArray("allow", ","), params.GetStringArray("deny", ",")) }
func NewAccess(params params.ModuleParams) *Access { return &Access{ Allow: params.GetArrayOrDefault("allow", []string{""}), Deny: params.GetArrayOrDefault("deny", []string{"*"}), } }
func NewRewrite(params params.ModuleParams) *Rewrite { return &Rewrite{ path: params.GetArray("path"), } }
func NewBasicAuth(params params.ModuleParams) *BasicAuth { return &BasicAuth{ username: params.GetString("username"), password: params.GetString("password"), } }
func NewDocker(params params.ModuleParams) *ModDocker { return &ModDocker{ socket: params.GetStringOrDefault("socket", "unix:///var/run/docker.sock"), } }