mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-03 21:43:06 +02:00
/exec API: drop session reconnection support (#487)
This commit is contained in:
@@ -10,26 +10,20 @@ import (
|
||||
type FrameType string
|
||||
|
||||
const (
|
||||
FrameTypeStdin FrameType = "stdin"
|
||||
FrameTypeResize FrameType = "resize"
|
||||
FrameTypeStdout FrameType = "stdout"
|
||||
FrameTypeStderr FrameType = "stderr"
|
||||
FrameTypeExit FrameType = "exit"
|
||||
FrameTypeError FrameType = "error"
|
||||
FrameTypeHistory FrameType = "history"
|
||||
FrameTypeNoMoreHistory FrameType = "no_more_history"
|
||||
FrameTypeAck FrameType = "ack"
|
||||
FrameTypeDetach FrameType = "detach"
|
||||
FrameTypeClose FrameType = "close"
|
||||
FrameTypeStdin FrameType = "stdin"
|
||||
FrameTypeResize FrameType = "resize"
|
||||
FrameTypeStdout FrameType = "stdout"
|
||||
FrameTypeStderr FrameType = "stderr"
|
||||
FrameTypeExit FrameType = "exit"
|
||||
FrameTypeError FrameType = "error"
|
||||
)
|
||||
|
||||
type Frame struct {
|
||||
Type FrameType `json:"type"`
|
||||
Data []byte `json:"data,omitempty"`
|
||||
Terminal *TerminalSize `json:"terminal,omitempty"`
|
||||
Exit *Exit `json:"exit,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Watermark uint64 `json:"watermark,omitempty"`
|
||||
Type FrameType `json:"type"`
|
||||
Data []byte `json:"data,omitempty"`
|
||||
Terminal *TerminalSize `json:"terminal,omitempty"`
|
||||
Exit *Exit `json:"exit,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type Exit struct {
|
||||
|
||||
@@ -7,21 +7,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestFrameRoundTripsWatermark(t *testing.T) {
|
||||
frame := Frame{
|
||||
Type: FrameTypeHistory,
|
||||
Watermark: 42,
|
||||
}
|
||||
|
||||
payload, err := json.Marshal(frame)
|
||||
require.NoError(t, err)
|
||||
|
||||
var decoded Frame
|
||||
err = json.Unmarshal(payload, &decoded)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, frame, decoded)
|
||||
}
|
||||
|
||||
func TestFrameRoundTripsTerminalSize(t *testing.T) {
|
||||
frame := Frame{
|
||||
Type: FrameTypeResize,
|
||||
|
||||
Reference in New Issue
Block a user