Documentation
¶
Index ¶
- Constants
- Variables
- 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 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
- func (c *WslCmd) CombinedOutput() (out []byte, err error)
- func (c *WslCmd) GetProcess() *os.Process
- func (c *WslCmd) GetProcessState() *os.ProcessState
- func (c *WslCmd) Output() (out []byte, err error)
- func (c *WslCmd) Run() error
- func (c *WslCmd) SetStderr(stderr io.Writer)
- func (c *WslCmd) SetStdin(stdin io.Reader)
- func (c *WslCmd) SetStdout(stdout io.Writer)
- func (c *WslCmd) Start() (err error)
- func (c *WslCmd) StderrPipe() (r io.ReadCloser, err error)
- func (c *WslCmd) StdinPipe() (w io.WriteCloser, err error)
- func (c *WslCmd) StdoutPipe() (r io.ReadCloser, err error)
- func (c *WslCmd) Wait() (err error)
- 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 ¶
View Source
var DefaultDistro = gowsl.DefaultDistro
View Source
var RegisteredDistros = gowsl.RegisteredDistros
Functions ¶
func CpHostToRemote ¶
func DisconnectClient ¶
func EnsureConnection ¶
Convenience function for ensuring a connection is established
func GetAllConnStatus ¶
func GetAllConnStatus() []wshrpc.ConnStatus
func IsPowershell ¶
Types ¶
type CancellableCmd ¶
type CancellableCmd struct {
Cmd *WslCmd
Cancel func()
}
type WshInstallOpts ¶
type WslCmd ¶
type WslCmd struct {
// contains filtered or unexported fields
}
func GetDistroCmd ¶
func (*WslCmd) CombinedOutput ¶
func (*WslCmd) GetProcess ¶
func (*WslCmd) GetProcessState ¶
func (c *WslCmd) GetProcessState() *os.ProcessState
func (*WslCmd) StderrPipe ¶
func (c *WslCmd) StderrPipe() (r io.ReadCloser, err error)
func (*WslCmd) StdoutPipe ¶
func (c *WslCmd) StdoutPipe() (r io.ReadCloser, err error)
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.