Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHostAlreadyRunning = errors.New("host already running")
ErrHostAlreadyRunning is returned when another host is already listening.
Functions ¶
func CleanStaleSocket ¶
func CleanStaleSocket()
CleanStaleSocket removes the socket file if no host is listening.
func IsHostRunning ¶
func IsHostRunning() bool
IsHostRunning checks if a host process is listening on the socket.
func SocketPath ¶
func SocketPath() string
SocketPath returns the Unix socket path for IPC, scoped to the current user.
Types ¶
type Handler ¶
type Handler func(req OpenRequest) OpenResponse
Handler is called when a new open request arrives from a CLI client.
type OpenRequest ¶
type OpenRequest struct {
ConfigPath string `json:"config_path"`
}
OpenRequest is sent from CLI to host to open a new window.
type OpenResponse ¶
type OpenResponse struct {
OK bool `json:"ok"`
WindowID string `json:"window_id,omitempty"`
Error string `json:"error,omitempty"`
Reused bool `json:"reused,omitempty"`
}
OpenResponse is sent from host back to CLI.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server listens on a Unix socket for IPC requests from CLI processes.
Click to show internal directories.
Click to hide internal directories.