Documentation ¶
Index ¶
- func WhereLx() (string, error)
- type Distro
- type LxRunOffline
- func (lx *LxRunOffline) ClearASCII(values []byte, shouldGetFirstLine bool) string
- func (lx *LxRunOffline) ExportDistro(distributionName string, tarDirFile string) error
- func (lx *LxRunOffline) GetDefaultDistro() (string, string, error)
- func (lx *LxRunOffline) GetDefaultDistroCmd() (string, *exec.Cmd, error)
- func (lx *LxRunOffline) GetDistroSummary(distro_uid string) (*Distro, error)
- func (lx *LxRunOffline) GetFirstLine(s string) string
- func (lx *LxRunOffline) GetRegistrySubkey(path string, value string) (v []string, err error)
- func (lx *LxRunOffline) GetRegistryValue(path string, value string) (v string, vtype uint32, err error)
- func (lx *LxRunOffline) GetRegistryValueInt(path string, value string) (v uint64, vtype uint32, err error)
- func (lx *LxRunOffline) GetSummaryCmd(distributionName string) (string, *exec.Cmd, error)
- func (lx *LxRunOffline) IsWSL2(flag uint64) bool
- func (lx *LxRunOffline) ListInstalled() ([]*Distro, error)
- func (lx *LxRunOffline) ListInstalledCmd() ([]string, *exec.Cmd, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Distro ¶
type LxRunOffline ¶
type LxRunOffline struct {
Options
}
func Init ¶
func Init(options Options) *LxRunOffline
Init(options) can be used to obtain custom location of lxrunoffline.exe
func New ¶
func New() (*LxRunOffline, error)
New()
Initialize and find where lxrunoffline.exe is installed to the machine. Use this initialize method if you have installed lxrunoffline via Chocolatey or Scoop. Also if you correctly install lxrunoffline.exe manually then added to Windows PATH
func (*LxRunOffline) ClearASCII ¶
func (lx *LxRunOffline) ClearASCII(values []byte, shouldGetFirstLine bool) string
func (*LxRunOffline) ExportDistro ¶
func (lx *LxRunOffline) ExportDistro(distributionName string, tarDirFile string) error
lx.ExportDistro(distributionName string, tarDirFile string)
Will export a distro into `*.tar.gz` file. You should provide the full path with name for `tarDirFile` params, e.g: "G:\WSL_Backup\debian.tar.gz". This function provided by LxRunOffline.exe
func (*LxRunOffline) GetDefaultDistro ¶
func (lx *LxRunOffline) GetDefaultDistro() (string, string, error)
lx.GetDefaultDistro()
Return distro name, distro_uid. Empty string will return if error occured. This function read Windows Registry
func (*LxRunOffline) GetDefaultDistroCmd ¶
func (lx *LxRunOffline) GetDefaultDistroCmd() (string, *exec.Cmd, error)
lx.GetDefaultDistroCmd()
Will show your default distro if you run `wsl` on command prompt. This function provided by LxRunOffline.exe. Return is string of distroName
func (*LxRunOffline) GetDistroSummary ¶
func (lx *LxRunOffline) GetDistroSummary(distro_uid string) (*Distro, error)
lx.GetDistroSummary(distro_uid string)
Return a distro with the info it has. This function read Windows Registry
func (*LxRunOffline) GetFirstLine ¶
func (lx *LxRunOffline) GetFirstLine(s string) string
func (*LxRunOffline) GetRegistrySubkey ¶
func (lx *LxRunOffline) GetRegistrySubkey(path string, value string) (v []string, err error)
func (*LxRunOffline) GetRegistryValue ¶
func (*LxRunOffline) GetRegistryValueInt ¶
func (*LxRunOffline) GetSummaryCmd ¶
lx.GetSummaryCmd(distributionName string)
Will show current summary by distributionName. This function provided by LxRunOffline.exe
func (*LxRunOffline) IsWSL2 ¶
func (lx *LxRunOffline) IsWSL2(flag uint64) bool
func (*LxRunOffline) ListInstalled ¶
func (lx *LxRunOffline) ListInstalled() ([]*Distro, error)
lx.ListInstalled()
Return list of distro with some infos. This function read Windows Registrys
func (*LxRunOffline) ListInstalledCmd ¶
func (lx *LxRunOffline) ListInstalledCmd() ([]string, *exec.Cmd, error)
lx.ListInstalledCmd()
Get list of installed distro on your machine. This function provided by LxRunOffline.exe and return list of distroName string