Documentation
¶
Index ¶
- Constants
- func BinaryHash(path string) (string, error)
- func DefaultRecordDir() (string, error)
- func DefaultSocketPath() (string, error)
- func DefaultTranscriptDir() (string, error)
- func FindSessiondBinary() (string, error)
- func WaitForShutdown(ctx context.Context, socketPath string) error
- type AttachReady
- type AttachRequest
- type Client
- func (c *Client) Attach(ctx context.Context, sessionID string, since int64, withBuffer bool, ...) (*Stream, StreamMessage, error)
- func (c *Client) Create(ctx context.Context, sessionID, cwd string) (CreateResponse, error)
- func (c *Client) GetOwner(ctx context.Context, sessionID string) (OwnerResponse, error)
- func (c *Client) Info(ctx context.Context) (InfoResponse, error)
- func (c *Client) Inspect(ctx context.Context, sessionID string) (InspectResponse, error)
- func (c *Client) List(ctx context.Context) (ListResponse, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) Resize(ctx context.Context, sessionID string, cols, rows int) error
- func (c *Client) ResizeWithOwner(ctx context.Context, sessionID string, cols, rows int, owner string) error
- func (c *Client) Send(ctx context.Context, sessionID, data string) error
- func (c *Client) SendWithOwner(ctx context.Context, sessionID, data, owner string) error
- func (c *Client) SetOwner(ctx context.Context, sessionID, owner string) error
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) ShutdownWithReason(ctx context.Context, source, reason string) error
- func (c *Client) Stop(ctx context.Context, sessionID string) error
- func (c *Client) StopWithOwner(ctx context.Context, sessionID, owner string) error
- type ControlRequest
- type ControlResponse
- type CreateRequest
- type CreateResponse
- type InfoResponse
- type InspectRequest
- type InspectResponse
- type ListResponse
- type Options
- type OwnerRequest
- type OwnerResponse
- type ResizeRequest
- type SendRequest
- type Server
- type Session
- type SessionInfo
- type ShutdownRequest
- type StartOptions
- type StopRequest
- type Stream
- type StreamMessage
- type WebsocketControlRequest
Constants ¶
View Source
const ProtocolVersion = 2
Variables ¶
This section is empty.
Functions ¶
func BinaryHash ¶
func DefaultRecordDir ¶
func DefaultSocketPath ¶
func DefaultTranscriptDir ¶
func FindSessiondBinary ¶
Types ¶
type AttachReady ¶
type AttachReady struct {
RequestedOffset int64 `json:"requestedOffset"`
ReplayStart int64 `json:"replayStart"`
ReplayNext int64 `json:"replayNext"`
CurrentOffset int64 `json:"currentOffset"`
ReplayRequested bool `json:"replayRequested"`
ReplayTruncated bool `json:"replayTruncated"`
ReplaySkipped bool `json:"replaySkipped"`
Owner string `json:"owner,omitempty"`
Running bool `json:"running"`
}
type AttachRequest ¶
type AttachRequest struct {
ProtocolVersion int `json:"protocolVersion"`
Type string `json:"type"`
SessionID string `json:"sessionId"`
StreamID string `json:"streamId,omitempty"`
ClientID string `json:"clientId,omitempty"`
Token string `json:"token,omitempty"`
Since int64 `json:"since,omitempty"`
WithBuffer bool `json:"withBuffer,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func EnsureRunningWithOptions ¶
func EnsureRunningWithOptions(ctx context.Context, opts StartOptions) (*Client, error)
func (*Client) ResizeWithOwner ¶
func (*Client) SendWithOwner ¶
func (*Client) ShutdownWithReason ¶
type ControlRequest ¶
type ControlRequest struct {
ProtocolVersion int `json:"protocolVersion"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type ControlResponse ¶
type CreateRequest ¶
type CreateResponse ¶
type InfoResponse ¶
type InspectRequest ¶
type InspectRequest struct {
SessionID string `json:"sessionId"`
}
type InspectResponse ¶
type ListResponse ¶
type ListResponse struct {
Sessions []SessionInfo `json:"sessions"`
}
type Options ¶
type Options struct {
SocketPath string
WebSocketHost string
TranscriptDir string
RecordDir string
IdleTimeout time.Duration
IdleTimeoutSet bool
BufferBytes int
TranscriptMaxBytes int64
TranscriptTrimThreshold int64
TranscriptTailBytes int64
RecordPty bool
Logger *log.Logger
ProtocolLogEnabled bool
ProtocolLogDir string
ProtocolLogger *unifiedlog.Logger
}
func DefaultOptions ¶
func DefaultOptions() Options
type OwnerRequest ¶
type OwnerResponse ¶
type ResizeRequest ¶
type SendRequest ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) SetShutdown ¶
func (s *Server) SetShutdown(fn func())
type SessionInfo ¶
type ShutdownRequest ¶
type StartOptions ¶
type StopRequest ¶
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) Next ¶
func (s *Stream) Next(msg *StreamMessage) error
type StreamMessage ¶
type StreamMessage struct {
Type string `json:"type"`
SessionID string `json:"sessionId,omitempty"`
StreamID string `json:"streamId,omitempty"`
RequestID string `json:"requestId,omitempty"`
DataB64 string `json:"dataB64,omitempty"`
Len int `json:"len,omitempty"`
NextOffset int64 `json:"nextOffset,omitempty"`
Ready *AttachReady `json:"ready,omitempty"`
Snapshot json.RawMessage `json:"snapshot,omitempty"`
Error string `json:"error,omitempty"`
}
type WebsocketControlRequest ¶
type WebsocketControlRequest struct {
ProtocolVersion int `json:"protocolVersion,omitempty"`
Type string `json:"type"`
Data string `json:"data,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
Owner string `json:"owner,omitempty"`
RequestID string `json:"requestId,omitempty"`
Snapshot json.RawMessage `json:"snapshot,omitempty"`
}
Source Files
¶
- binary.go
- buffer.go
- client.go
- daemon_unix.go
- debug_bytes.go
- debug_log.go
- options.go
- paths.go
- protocol.go
- pty_unix.go
- server.go
- session.go
- session_attach.go
- session_input_filter.go
- session_lifecycle.go
- session_log.go
- session_modes.go
- session_output_filter.go
- session_persist.go
- session_protocol.go
- session_replay_filter.go
- session_snapshot.go
- stream.go
- ws.go
Click to show internal directories.
Click to hide internal directories.