Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HostRulesFactory = factory.NewFactory(models.HostRules{}). Attr( "Host", func(args factory.Args) (interface{}, error) { return fake.DomainName(), nil }, ). SubFactory("DefaultTarget", TargetFactory). SubSliceFactory( "Rules", RuleFactory, func() int { return rand.Intn(5) }, )
HostRulesFactory generate HostRule
View Source
var RuleFactory = factory.NewFactory(models.Rule{}). SubFactory("Target", TargetFactory). Attr("Resolver", func(args factory.Args) (interface{}, error) { return "simple", nil }). Attr("SourcePath", pathFactory)
RuleFactory generate models.Rule
View Source
var TargetFactory = factory.NewFactory(models.Target{}). Attr( "HTTPCode", func(args factory.Args) (interface{}, error) { return 300 + rand.Int31n(100), nil }, ). Attr("Path", pathFactory)
TargetFactory generate models.Target
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.