-
Notifications
You must be signed in to change notification settings - Fork 474
/
options.go
43 lines (32 loc) · 1.04 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package generator
import (
"fmt"
"k8s.io/client-go/kubernetes"
)
// Options used to configure a Generator.
type Options struct {
// Cluster is the name of the cluster all nodes will live in.
Cluster *string
// IncludeBoxing determines whether nodes will include boxing or not.
IncludeBoxing *bool
// KubeClient if passed enables talking to the kube api to get/create namespaces.
KubeClient kubernetes.Interface
// NumberOfApps sets how many apps to create.
NumberOfApps *int
// NumberOfIngress sets how many ingress to create.
NumberOfIngress *int
// PopulationStrategy determines how many connections from ingress i.e. dense or sparse.
PopulationStrategy *string
}
// PopStratValue implements flag.Value interface so pop strategy can be used
// as a flag.
type PopStratValue string
func (p *PopStratValue) String() string {
return fmt.Sprint(*p)
}
func (i *PopStratValue) Set(value string) error {
if value != Dense && value != Sparse {
return fmt.Errorf("%s is not valid. Use: '%s' or '%s'", value, Dense, Sparse)
}
return nil
}