-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use channels to pass data to the debug tui #75
Conversation
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
func (ref *Output) Data(channelKey string, data interface{}) { | ||
if ch, exists := ref.DataChannels[channelKey]; exists { | ||
ch <- data // Send data to the corresponding channel | ||
fmt.Printf("Data sent to channel '%s': %v\n", channelKey, data) |
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.
let's use logrus log instead of fmt.Printf
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.
Noted. Will update / remove.
ch <- data // Send data to the corresponding channel | ||
fmt.Printf("Data sent to channel '%s': %v\n", channelKey, data) | ||
} else { | ||
fmt.Printf("Channel for channelKey '%s' not found\n", channelKey) |
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.
let's use logrus log instead of fmt.Printf
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.
Noted. Will update / remove.
What
debug
tui via an internal channel on execution context.Info
to a provideddataChannel
via aninternalDataCh
[note - channel naming should be consistent]OutputFormat
for execution context is specified as"subscription"
- then the channels are used to pipe data. This is only implemented for.Info
at the moment for this Proof of Concept.Why
Questions
debug --tui
effectively drops all other provided flags on the floor. This could be a poor UX.--tui
flag as a standalone flag, then perform interactions inside of the interface?debug --tui --runtime=k8s --target=my-nginx
be a desired entrypoint to support? DevX wise - for ease of using the last invoked command without writing out things by hand in a TUI, supporting flags alongside --tui feels relevant.How Tested
mint debug --tui
mint images --tui
mint tui
->d