@@ -11,8 +11,8 @@ type tX509Column struct {
11
11
isShown func (tConfig ) bool
12
12
title func () string
13
13
titleColor color.Attribute
14
- contentSource func (tX509CertificateWithRevocation , tConfig ) string
15
- contentColor func (tX509CertificateWithRevocation ) color.Attribute
14
+ contentSource func (tX509CertificateProvisionerRevocation , tConfig ) string
15
+ contentColor func (tX509CertificateProvisionerRevocation ) color.Attribute
16
16
contentAlignMD int
17
17
contentEscapeMD bool
18
18
}
@@ -22,19 +22,19 @@ getX509Columns defines look and content of table's emitted columns.
22
22
*/
23
23
func getX509Columns () []tX509Column {
24
24
25
- var thisColumns []tX509Column
25
+ var columns []tX509Column
26
26
27
- thisColumns = append (thisColumns ,
27
+ columns = append (columns ,
28
28
29
29
tX509Column {
30
30
isShown : func (_ tConfig ) bool { return true }, // Always shown.
31
31
title : func () string { return "Serial number" }, // Static title.
32
32
titleColor : color .Bold ,
33
33
34
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
34
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
35
35
return x .X509Certificate .SerialNumber .String ()
36
36
},
37
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
37
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
38
38
contentAlignMD : ALIGN_RIGHT ,
39
39
contentEscapeMD : false ,
40
40
},
@@ -44,8 +44,10 @@ func getX509Columns() []tX509Column {
44
44
title : func () string { return "Subject" }, // Static title.
45
45
titleColor : color .Bold ,
46
46
47
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string { return x .X509Certificate .Subject .String () },
48
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgHiWhite }, // Static color.
47
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
48
+ return x .X509Certificate .Subject .String ()
49
+ },
50
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgHiWhite }, // Static color.
49
51
contentAlignMD : ALIGN_LEFT ,
50
52
contentEscapeMD : true ,
51
53
},
@@ -55,10 +57,10 @@ func getX509Columns() []tX509Column {
55
57
title : func () string { return "DNSNames" }, // Static title.
56
58
titleColor : color .Bold ,
57
59
58
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
60
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
59
61
return strings .Join (x .X509Certificate .DNSNames , ", " )
60
62
},
61
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
63
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
62
64
contentAlignMD : ALIGN_LEFT ,
63
65
contentEscapeMD : true ,
64
66
},
@@ -68,10 +70,10 @@ func getX509Columns() []tX509Column {
68
70
title : func () string { return "EmailAddresses" }, // Static title.
69
71
titleColor : color .Bold ,
70
72
71
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
73
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
72
74
return strings .Join (x .X509Certificate .EmailAddresses , ", " )
73
75
},
74
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
76
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
75
77
contentAlignMD : ALIGN_LEFT ,
76
78
contentEscapeMD : true ,
77
79
},
@@ -81,14 +83,14 @@ func getX509Columns() []tX509Column {
81
83
title : func () string { return "IPAddresses" }, // Static title.
82
84
titleColor : color .Bold ,
83
85
84
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
85
- var thisIPAddresses []string
86
- for _ , thisIPAddress := range x .X509Certificate .IPAddresses {
87
- thisIPAddresses = append (thisIPAddresses , thisIPAddress .String ())
86
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
87
+ var ipAddresses []string
88
+ for _ , ipAddress := range x .X509Certificate .IPAddresses {
89
+ ipAddresses = append (ipAddresses , ipAddress .String ())
88
90
}
89
- return strings .Join (thisIPAddresses , ", " )
91
+ return strings .Join (ipAddresses , ", " )
90
92
},
91
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
93
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
92
94
contentAlignMD : ALIGN_LEFT ,
93
95
contentEscapeMD : true ,
94
96
},
@@ -98,14 +100,14 @@ func getX509Columns() []tX509Column {
98
100
title : func () string { return "URIs" }, // Static title.
99
101
titleColor : color .Bold ,
100
102
101
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
102
- var thisUris []string
103
- for _ , thisUri := range x .X509Certificate .URIs {
104
- thisUris = append (thisUris , thisUri .String ())
103
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
104
+ var uris []string
105
+ for _ , uri := range x .X509Certificate .URIs {
106
+ uris = append (uris , uri .String ())
105
107
}
106
- return strings .Join (thisUris , ", " )
108
+ return strings .Join (uris , ", " )
107
109
},
108
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
110
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
109
111
contentAlignMD : ALIGN_LEFT ,
110
112
contentEscapeMD : true ,
111
113
},
@@ -115,10 +117,10 @@ func getX509Columns() []tX509Column {
115
117
title : func () string { return "CRLDistributionPoints" }, // Static title.
116
118
titleColor : color .Bold ,
117
119
118
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
120
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
119
121
return strings .Join (x .X509Certificate .CRLDistributionPoints , ", " )
120
122
},
121
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
123
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
122
124
contentAlignMD : ALIGN_LEFT ,
123
125
contentEscapeMD : true ,
124
126
},
@@ -128,10 +130,10 @@ func getX509Columns() []tX509Column {
128
130
title : func () string { return "Provisioner" }, // Static title.
129
131
titleColor : color .Bold ,
130
132
131
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
133
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
132
134
return (x .X509Provisioner .Type + " " + x .X509Provisioner .Name [:min (len (x .X509Provisioner .Name ), 6 )])
133
135
},
134
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgWhite }, // Static color.
136
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgWhite }, // Static color.
135
137
contentAlignMD : ALIGN_LEFT ,
136
138
contentEscapeMD : true ,
137
139
},
@@ -141,14 +143,14 @@ func getX509Columns() []tX509Column {
141
143
title : func () string { return "Start" }, // Static title.
142
144
titleColor : color .Bold ,
143
145
144
- contentSource : func (x tX509CertificateWithRevocation , tc tConfig ) string {
146
+ contentSource : func (x tX509CertificateProvisionerRevocation , tc tConfig ) string {
145
147
if tc .timeFormat .Value == "s" {
146
148
return x .X509Certificate .NotBefore .UTC ().Format (time .DateOnly )
147
149
} else {
148
150
return x .X509Certificate .NotBefore .UTC ().Format (time .RFC3339 )
149
151
}
150
152
},
151
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgHiBlack }, // Static color.
153
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgHiBlack }, // Static color.
152
154
contentAlignMD : ALIGN_LEFT ,
153
155
contentEscapeMD : true ,
154
156
},
@@ -158,14 +160,14 @@ func getX509Columns() []tX509Column {
158
160
title : func () string { return "Finish" }, // Static title.
159
161
titleColor : color .Bold ,
160
162
161
- contentSource : func (x tX509CertificateWithRevocation , tc tConfig ) string {
163
+ contentSource : func (x tX509CertificateProvisionerRevocation , tc tConfig ) string {
162
164
if tc .timeFormat .Value == "s" {
163
165
return x .X509Certificate .NotAfter .UTC ().Format (time .DateOnly )
164
166
} else {
165
167
return x .X509Certificate .NotAfter .UTC ().Format (time .RFC3339 )
166
168
}
167
169
},
168
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgHiBlack }, // Static color.
170
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgHiBlack }, // Static color.
169
171
contentAlignMD : ALIGN_LEFT ,
170
172
contentEscapeMD : true ,
171
173
},
@@ -175,7 +177,7 @@ func getX509Columns() []tX509Column {
175
177
title : func () string { return "Revoked at" }, // Static title.
176
178
titleColor : color .Bold ,
177
179
178
- contentSource : func (x tX509CertificateWithRevocation , tc tConfig ) string {
180
+ contentSource : func (x tX509CertificateProvisionerRevocation , tc tConfig ) string {
179
181
if len (x .X509Revocation .ProvisionerID ) > 0 {
180
182
if tc .timeFormat .Value == "s" {
181
183
return x .X509Revocation .RevokedAt .UTC ().Format (time .DateOnly )
@@ -186,7 +188,7 @@ func getX509Columns() []tX509Column {
186
188
return ""
187
189
}
188
190
},
189
- contentColor : func (_ tX509CertificateWithRevocation ) color.Attribute { return color .FgHiBlack }, // Static color.
191
+ contentColor : func (_ tX509CertificateProvisionerRevocation ) color.Attribute { return color .FgHiBlack }, // Static color.
190
192
contentAlignMD : ALIGN_LEFT ,
191
193
contentEscapeMD : true ,
192
194
},
@@ -196,16 +198,16 @@ func getX509Columns() []tX509Column {
196
198
title : func () string { return "Validity" }, // Static title.
197
199
titleColor : color .Bold ,
198
200
199
- contentSource : func (x tX509CertificateWithRevocation , _ tConfig ) string {
201
+ contentSource : func (x tX509CertificateProvisionerRevocation , _ tConfig ) string {
200
202
return x .Validity
201
203
},
202
- contentColor : func (x tX509CertificateWithRevocation ) color.Attribute {
203
- return getThisValidityColor ()[x .Validity ]
204
+ contentColor : func (x tX509CertificateProvisionerRevocation ) color.Attribute {
205
+ return getValidityColor ()[x .Validity ]
204
206
}, // Dynamic color
205
207
contentAlignMD : ALIGN_LEFT ,
206
208
contentEscapeMD : true ,
207
209
},
208
210
)
209
211
210
- return thisColumns
212
+ return columns
211
213
}
0 commit comments