-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
58 lines (53 loc) · 1.63 KB
/
models.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"github.com/aws/aws-sdk-go/service/autoscaling"
)
type AutoScalingGroup struct {
Name string
MinSize int64
MaxSize int64
DesiredCapacity int64
MaxInstanceLimit int64
}
type Asg struct {
Name string `yaml:"name"`
Tags []string `yaml:"tags"`
MaxAsgCapacity int `yaml:"max-asg-capacity"`
ScaleToZero bool `yaml:"scale-to-zero"`
Region string `yaml:"region"`
}
type GitLabConfig struct {
Token string `yaml:"token"`
Group string `yaml:"group"`
ExcludeProjects []string `yaml:"exclude-projects"`
}
type AutoscalerConfig struct {
CheckInterval int `yaml:"check-interval"`
}
type AWSConfig struct {
AsgNames []Asg `yaml:"asg-names"`
}
type Config struct {
GitLab GitLabConfig `yaml:"gitlab"`
Autoscaler AutoscalerConfig `yaml:"autoscaler"`
AWS AWSConfig `yaml:"aws"`
}
type Project struct {
ID int `json:"id"`
Name string `json:"name"`
PendingTagList []string `json:"pending_tag_list"`
RunningTagList []string `json:"running_tag_list"`
}
type AWSService interface {
DescribeAutoScalingGroups(input *autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error)
}
type AWSClient struct {
svc AutoScalingAPI
}
type AWSClients struct {
clients map[string]AWSService
}
type AutoScalingAPI interface {
DescribeAutoScalingGroups(*autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error)
UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error)
}