mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 17:52:33 +02:00
e8e64eff12
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
19 lines
413 B
Go
19 lines
413 B
Go
package intercept
|
|
|
|
import tea "charm.land/bubbletea/v2"
|
|
|
|
type RequestArrivedMsg struct{ Req *PendingRequest }
|
|
type ResponseArrivedMsg struct{ Resp *PendingResponse }
|
|
|
|
func WaitForRequest(b *Broker) tea.Cmd {
|
|
return func() tea.Msg {
|
|
return RequestArrivedMsg{Req: <-b.Incoming}
|
|
}
|
|
}
|
|
|
|
func WaitForResponse(b *Broker) tea.Cmd {
|
|
return func() tea.Msg {
|
|
return ResponseArrivedMsg{Resp: <-b.IncomingResponse}
|
|
}
|
|
}
|