-
Notifications
You must be signed in to change notification settings - Fork 68
feat: include Callbacks on clients create and list #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| func apiCallbacksFor(s []string) []interface{} { | ||
| res := make([]interface{}, len(s)) | ||
| for i, v := range s { | ||
| res[i] = v | ||
| } | ||
| return res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a 1-liner to convert from []string to []interface{} 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah there's none :) It's the reason the generics troll gets fueled :)
| func (v *clientView) AsTableHeader() []string { | ||
| if v.revealSecret { | ||
| return []string{"Name", "Type", "ClientID", "Client Secret"} | ||
| return []string{"Name", "Type", "ClientID", "Client Secret", "Callbacks"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a refactor here regarding how the columns are included/excluded will be needed at some point (probably not for the PoC)
| func (v *clientView) AsTableRow() []string { | ||
| if v.revealSecret { | ||
| return []string{v.Name, v.Type, ansi.Faint(v.ClientID), ansi.Italic(v.ClientSecret)} | ||
| return []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, potential combinations are going to make this hard to maintain
| func callbacksFor(s []interface{}) []string { | ||
| res := make([]string, len(s)) | ||
| for i, v := range s { | ||
| res[i] = fmt.Sprintf("%s", v) | ||
| } | ||
| return res | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a simpler way to convert from []interface{} -> []string ?
with --format=json
