-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathtest.go
40 lines (32 loc) · 865 Bytes
/
test.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
package common
func Int64Ptr(v int64) *int64 {
return &v
}
type TestRunnerConfig struct {
RunnerConfig *RunnerConfig
}
func NewTestRunnerConfig() *TestRunnerConfig {
return &TestRunnerConfig{
RunnerConfig: &RunnerConfig{},
}
}
func (c *TestRunnerConfig) WithAutoscalerConfig(ac *AutoscalerConfig) *TestRunnerConfig {
c.RunnerConfig.Autoscaler = ac
return c
}
func (c *TestRunnerConfig) WithToken(token string) *TestRunnerConfig {
c.RunnerConfig.RunnerCredentials.Token = token
return c
}
type TestAutoscalerConfig struct {
AutoscalerConfig *AutoscalerConfig
}
func NewTestAutoscalerConfig() *TestAutoscalerConfig {
return &TestAutoscalerConfig{
AutoscalerConfig: &AutoscalerConfig{},
}
}
func (c *TestAutoscalerConfig) WithPolicies(policies ...AutoscalerPolicyConfig) *TestAutoscalerConfig {
c.AutoscalerConfig.Policy = policies
return c
}