egg

package
v0.7.30 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 21 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 wraps the generated gRPC client for the egg.

func Dial

func Dial(socketPath, tokenPath string) (*Client, error)

Dial connects to the egg Unix socket and reads the auth token.

func (*Client) AttachSession

func (c *Client) AttachSession(ctx context.Context, sessionID string) (pb.Egg_SessionClient, error)

AttachSession opens a bidirectional stream for PTY I/O.

func (*Client) Close

func (c *Client) Close() error

Close closes the gRPC connection.

func (*Client) Kill

func (c *Client) Kill(ctx context.Context, sessionID string) error

Kill terminates a session.

func (*Client) List

func (c *Client) List(ctx context.Context) (*pb.ListResponse, error)

List returns all active sessions.

func (*Client) Resize

func (c *Client) Resize(ctx context.Context, sessionID string, rows, cols uint32) error

Resize changes terminal dimensions of a session.

func (*Client) Spawn

func (c *Client) Spawn(ctx context.Context, req *pb.SpawnRequest) (*pb.SpawnResponse, error)

Spawn creates a new PTY session in the egg.

func (*Client) Version

func (c *Client) Version(ctx context.Context) (string, error)

Version returns the egg's binary version.

type Server

type Server struct {
	pb.UnimplementedEggServer
	// contains filtered or unexported fields
}

Server implements the Egg gRPC service — holds PTY fds across wing restarts.

func NewServer

func NewServer(dir, version string) (*Server, error)

NewServer creates a new egg server. The dir should be ~/.wingthing. The version string is recorded so wings can detect version mismatches.

func (*Server) Kill

func (s *Server) Kill(ctx context.Context, req *pb.KillRequest) (*pb.KillResponse, error)

Kill terminates a session.

func (*Server) List

func (s *Server) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)

List returns all active sessions.

func (*Server) Resize

func (s *Server) Resize(ctx context.Context, req *pb.ResizeRequest) (*pb.ResizeResponse, error)

Resize changes the terminal dimensions of a session.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the gRPC server. Blocks until context is cancelled or idle timeout.

func (*Server) Session

func (s *Server) Session(stream pb.Egg_SessionServer) error

Session implements the bidirectional PTY I/O stream.

func (*Server) Spawn

func (s *Server) Spawn(ctx context.Context, req *pb.SpawnRequest) (*pb.SpawnResponse, error)

Spawn creates a new PTY session.

func (*Server) Version

func (s *Server) Version(ctx context.Context, req *pb.VersionRequest) (*pb.VersionResponse, error)

Version returns the egg's binary version.

type Session

type Session struct {
	ID        string
	PID       int
	Agent     string
	CWD       string
	Isolation string
	StartedAt time.Time
	// contains filtered or unexported fields
}

Session holds a single PTY process and its state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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