Documentation ¶
Index ¶
- Constants
- func CpHostToRemote(ctx context.Context, client *Distro, sourcePath string, destPath string) error
- func DetectShell(ctx context.Context, client *Distro) (string, error)
- func DisconnectClient(connName string) error
- func EnsureConnection(ctx context.Context, connName string) error
- func GetAllConnStatus() []wshrpc.ConnStatus
- func GetClientArch(ctx context.Context, client *Distro) (string, error)
- func GetClientOs(ctx context.Context, client *Distro) (string, error)
- func GetHomeDir(ctx context.Context, client *Distro) string
- func GetNumWSLHasConnected() int
- func GetWshPath(ctx context.Context, client *Distro) string
- func GetWshVersion(ctx context.Context, client *Distro) (string, error)
- func InstallClientRcFiles(ctx context.Context, client *Distro) error
- func IsPowershell(shellPath string) bool
- type CancellableCmd
- type Distro
- type WshInstallOpts
- type WslCmd
- type WslConn
- func (conn *WslConn) CheckAndInstallWsh(ctx context.Context, clientDisplayName string, opts *WshInstallOpts) error
- func (conn *WslConn) Close() error
- func (conn *WslConn) Connect(ctx context.Context) error
- func (conn *WslConn) DeriveConnStatus() wshrpc.ConnStatus
- func (conn *WslConn) FireConnChangeEvent()
- func (conn *WslConn) GetClient() *Distro
- func (conn *WslConn) GetDomainSocketName() string
- func (conn *WslConn) GetName() string
- func (conn *WslConn) GetStatus() string
- func (conn *WslConn) OpenDomainSocketListener() error
- func (conn *WslConn) Reconnect(ctx context.Context) error
- func (conn *WslConn) StartConnServer() error
- func (conn *WslConn) WaitForConnect(ctx context.Context) error
- func (conn *WslConn) WithLock(fn func())
- type WslName
Constants ¶
View Source
const ( Status_Init = "init" Status_Connecting = "connecting" Status_Connected = "connected" Status_Disconnected = "disconnected" Status_Error = "error" )
View Source
const DefaultConnectionTimeout = 60 * time.Second
Variables ¶
This section is empty.
Functions ¶
func CpHostToRemote ¶
func DisconnectClient ¶
func EnsureConnection ¶
Convenience function for ensuring a connection is established
func GetAllConnStatus ¶
func GetAllConnStatus() []wshrpc.ConnStatus
func GetNumWSLHasConnected ¶ added in v0.9.3
func GetNumWSLHasConnected() int
func IsPowershell ¶
Types ¶
type CancellableCmd ¶
type CancellableCmd struct { Cmd *WslCmd Cancel func() }
type WshInstallOpts ¶
type WslCmd ¶
just use the regular cmd since it's similar enough to not cause issues type WslCmd = exec.Cmd
func GetDistroCmd ¶
func (*WslCmd) GetProcess ¶
func (*WslCmd) GetProcessState ¶
func (wc *WslCmd) GetProcessState() *os.ProcessState
type WslConn ¶
type WslConn struct { Lock *sync.Mutex Status string Name WslName Client *Distro SockName string DomainSockListener net.Listener ConnController *WslCmd Error string HasWaiter *atomic.Bool LastConnectTime int64 ActiveConnNum int Context context.Context // contains filtered or unexported fields }
func (*WslConn) CheckAndInstallWsh ¶
func (*WslConn) DeriveConnStatus ¶
func (conn *WslConn) DeriveConnStatus() wshrpc.ConnStatus
func (*WslConn) FireConnChangeEvent ¶
func (conn *WslConn) FireConnChangeEvent()
func (*WslConn) GetDomainSocketName ¶
func (*WslConn) OpenDomainSocketListener ¶
*
- This function is does not set a listener for WslConn
- It is still required in order to set SockName
*
func (*WslConn) StartConnServer ¶
Click to show internal directories.
Click to hide internal directories.