attach

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Short

func Short(sid string) string

Types

type Control

type Control struct {
	Type    string `json:"type"`
	Cols    uint16 `json:"cols,omitempty"`
	Rows    uint16 `json:"rows,omitempty"`
	Owner   bool   `json:"owner,omitempty"`
	Viewers int    `json:"viewers,omitempty"`
	Holder  string `json:"holder,omitempty"`
	Viewer  int    `json:"viewer,omitempty"`
	Code    int    `json:"code,omitempty"`
}

type Hub

type Hub struct {
	Bin    string
	Attach func(id string) *exec.Cmd
	// contains filtered or unexported fields
}

func (*Hub) Drive

func (h *Hub) Drive(ctx context.Context, id string, fn func(*Typist) error) error

func (*Hub) Keys

func (h *Hub) Keys(ctx context.Context, id string, keys ...string) error

func (*Hub) Run

func (h *Hub) Run(w http.ResponseWriter, r *http.Request, id string, cmd *exec.Cmd, watch func(context.Context, *exec.Cmd))

Run gives a browser a terminal on cmd instead of on a session; watch runs alongside it until the viewer is gone.

func (*Hub) Send

func (h *Hub) Send(ctx context.Context, id, text string) error

func (*Hub) Serve

func (h *Hub) Serve(w http.ResponseWriter, r *http.Request, id string)

func (*Hub) Viewing

func (h *Hub) Viewing(id string) bool

type Typist

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

func (*Typist) Key

func (t *Typist) Key(k string) error

func (*Typist) Screen

func (t *Typist) Screen() string

Jump to

Keyboard shortcuts

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