File tree 2 files changed +30
-2
lines changed 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -192,3 +192,30 @@ func (textFormat) AttachOptions(_ *clibase.OptionSet) {}
192
192
func (textFormat ) Format (_ context.Context , data any ) (string , error ) {
193
193
return fmt .Sprintf ("%s" , data ), nil
194
194
}
195
+
196
+ type DataChangeFormat struct {
197
+ format OutputFormat
198
+ change func (data any ) (any , error )
199
+ }
200
+
201
+ // ChangeFormatterData allows manipulating the data passed to an output
202
+ // format.
203
+ func ChangeFormatterData (format OutputFormat , change func (data any ) (any , error )) * DataChangeFormat {
204
+ return & DataChangeFormat {format : format , change : change }
205
+ }
206
+
207
+ func (d * DataChangeFormat ) ID () string {
208
+ return d .format .ID ()
209
+ }
210
+
211
+ func (d * DataChangeFormat ) AttachOptions (opts * clibase.OptionSet ) {
212
+ d .format .AttachOptions (opts )
213
+ }
214
+
215
+ func (d * DataChangeFormat ) Format (ctx context.Context , data any ) (string , error ) {
216
+ newData , err := d .change (data )
217
+ if err != nil {
218
+ return "" , err
219
+ }
220
+ return d .format .Format (ctx , newData )
221
+ }
Original file line number Diff line number Diff line change @@ -33,8 +33,9 @@ type CreateWorkspaceProxyRequest struct {
33
33
}
34
34
35
35
type CreateWorkspaceProxyResponse struct {
36
- Proxy WorkspaceProxy `json:"proxy" table:"proxy,recursive,default_sort"`
37
- ProxyToken string `json:"proxy_token"`
36
+ Proxy WorkspaceProxy `json:"proxy" table:"proxy,recursive"`
37
+ // The recursive table sort is not working very well.
38
+ ProxyToken string `json:"proxy_token" table:"proxy token,default_sort"`
38
39
}
39
40
40
41
func (c * Client ) CreateWorkspaceProxy (ctx context.Context , req CreateWorkspaceProxyRequest ) (CreateWorkspaceProxyResponse , error ) {
You can’t perform that action at this time.
0 commit comments