Documentation
¶
Overview ¶
Package workspaceexec implements the native execution surface of a workspace. Transport and UI clients do not need OS-specific file or resource shell scripts.
Index ¶
- Constants
- Variables
- func Executable(name string) (string, error)
- type Content
- type ExecRequest
- type ExecResult
- type File
- type Info
- type Resources
- type Service
- func (s *Service) BusyPath(path string) bool
- func (s *Service) Delete(path string) error
- func (s *Service) Exec(ctx context.Context, req ExecRequest, output func(string, []byte)) (ExecResult, error)
- func (s *Service) Files(ctx context.Context, path, query string) ([]File, error)
- func (s *Service) Info() Info
- func (s *Service) Path(path string) (string, error)
- func (s *Service) Read(path string) (Content, error)
- func (s *Service) Resources(ctx context.Context) (Resources, error)
- func (s *Service) SetMutationGuard(gate *sync.Mutex, check func(string) error)
- func (s *Service) Write(path, content string) error
- type Terminal
- type TerminalEvent
- type TerminalInput
- type TerminalRequest
- type TerminalState
- type Terminals
Constants ¶
const MaxFileBytes = 4 << 20
const TerminalVersion = 1
const Version = 1
Variables ¶
var ErrTerminalInputInterrupted = errors.New("terminal input interrupted before delivery")
No PTY bytes or receipt were written: replaying this same input is safe.
Functions ¶
func Executable ¶
Types ¶
type ExecRequest ¶
type ExecResult ¶
type Service ¶
func (*Service) Exec ¶
func (s *Service) Exec(ctx context.Context, req ExecRequest, output func(string, []byte)) (ExecResult, error)
func (*Service) SetMutationGuard ¶
SetMutationGuard shares admission with turns and project transactions. Configure it before serving requests; the release lasts until a command/terminal exits.
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
func (*Terminal) State ¶
func (t *Terminal) State() TerminalState
func (*Terminal) Subscribe ¶
func (t *Terminal) Subscribe(after uint64) ([]TerminalEvent, <-chan TerminalEvent, func())
type TerminalEvent ¶
type TerminalEvent struct {
Sequence uint64 `json:"sequence"`
Kind string `json:"kind"`
Data string `json:"data,omitempty"` // Base64 preserves partial UTF-8 and arbitrary terminal bytes.
State *TerminalState `json:"state,omitempty"`
}
type TerminalInput ¶
type TerminalRequest ¶
type TerminalState ¶
type Terminals ¶
type Terminals struct {
// contains filtered or unexported fields
}
func NewTerminals ¶
func (*Terminals) List ¶
func (m *Terminals) List(directory string) []TerminalState
func (*Terminals) Open ¶
func (m *Terminals) Open(req TerminalRequest) (TerminalState, error)