/
elb_trust_store_associations.go
55 lines (48 loc) · 1.06 KB
/
elb_trust_store_associations.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
package main
import (
"github.com/aws/aws-sdk-go-v2/aws/arn"
"github.com/bporter816/aws-tui/repo"
"github.com/bporter816/aws-tui/ui"
"github.com/bporter816/aws-tui/view"
)
type ELBTrustStoreAssociations struct {
*ui.Table
view.ELB
repo *repo.ELB
a arn.ARN
app *Application
}
func NewELBTrustStoreAssociations(repo *repo.ELB, a arn.ARN, app *Application) *ELBTrustStoreAssociations {
e := &ELBTrustStoreAssociations{
Table: ui.NewTable([]string{
"ARN",
}, 1, 0),
repo: repo,
a: a,
app: app,
}
return e
}
func (e ELBTrustStoreAssociations) GetLabels() []string {
return []string{e.a.Resource, "Associations"}
}
func (e ELBTrustStoreAssociations) GetKeyActions() []KeyAction {
return []KeyAction{}
}
func (e ELBTrustStoreAssociations) Render() {
model, err := e.repo.ListTrustStoreAssociations(e.a)
if err != nil {
panic(err)
}
var data [][]string
for _, v := range model {
var resourceArn string
if v.ResourceArn != nil {
resourceArn = *v.ResourceArn
}
data = append(data, []string{
resourceArn,
})
}
e.SetData(data)
}