controlsocket

package
v0.0.0-...-7fc3621 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client owns the agent side of the server-initiated sandbox control socket. It intentionally only knows about generic named changes and byte streams; feature-specific protocols are layered on top by callers.

func New

func New() *Client

func (*Client) OpenStream

func (c *Client) OpenStream(ctx context.Context, channel string, payload any) (*Stream, error)

OpenStream opens a named byte stream. The channel name should identify the feature and request, for example "git:123".

func (*Client) PostChange

func (c *Client) PostChange(ctx context.Context, name string, payload any) error

PostChange publishes a named control change with an arbitrary JSON payload.

func (*Client) ServeWebSocket

func (c *Client) ServeWebSocket(w http.ResponseWriter, r *http.Request)

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream is a named byte stream over the control socket.

func (*Stream) Channel

func (s *Stream) Channel() string

func (*Stream) Close

func (s *Stream) Close() error

func (*Stream) CloseWrite

func (s *Stream) CloseWrite() error

func (*Stream) Frames

func (s *Stream) Frames() <-chan shared.Frame

func (*Stream) Read

func (s *Stream) Read(p []byte) (int, error)

func (*Stream) Write

func (s *Stream) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL