windows

package
v0.0.7-pre-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arch

func Arch() string

Arch retrieves the runtime architecture. This might differ from the compile time architecture. hence GOARCH can't be used here.

func CreateJunctions added in v0.0.4

func CreateJunctions(junctions ...[2]string) error

CreateJunction will create multiple junctions. Each pair reflects one junction ([2]string{existing_dir, link_location}). A junction as a hardlink to a directory. This means, that we hardlink to the drive-sections, which results in deletions not affecting the actual data, as long as there are still references.

func GetDirFilenames added in v0.0.4

func GetDirFilenames(dir string) ([]string, error)

func GetPersistentEnvValue added in v0.0.4

func GetPersistentEnvValue(key string) (string, string, error)

GetPersistentEnvValue retrieves a persistent user level environment variable. The first returned value is the key and the second the value. While the key is defined in the query, the casing might be different, which COULD matter. If nothing was found, we return empty strings without an error.

func GetPersistentEnvValues added in v0.0.4

func GetPersistentEnvValues() (map[string]string, error)

func GetShellExecutable added in v0.0.4

func GetShellExecutable() (string, error)

func SetPersistentEnvValue added in v0.0.4

func SetPersistentEnvValue(key, value string) error

Sets a User-Level Environment variable. An empty value will remove the key completly.

func SetPersistentEnvValues added in v0.0.4

func SetPersistentEnvValues(vars ...[2]string) error

Types

type PROCESSENTRY32 added in v0.0.4

type PROCESSENTRY32 struct {
	Size uint32

	ProcessID uint32

	ParentProcessID uint32

	// ExeFile is expected to be at max 260 chars, as windows by default doesn't
	// support long paths. While this could fail, we'll ignore this for now, as
	// it is unlikely to happen.
	ExeFile [260]uint16
	// contains filtered or unexported fields
}

PROCESSENTRY32 is a process as defined by Windows. We've simple padded everything with unused field, to be able to parse everything and indicate that the fields are unused at the same time.

type Paths added in v0.0.4

type Paths []string

func ParsePath added in v0.0.4

func ParsePath(value string) Paths

ParsePath will break the path variable content down into separate paths. This also handles quoting. The order is preserved.

func (Paths) Prepend added in v0.0.4

func (p Paths) Prepend(paths ...string) Paths

Preprend will create a new Paths object, adding the supplied paths infront, using the given order.

func (Paths) Remove added in v0.0.4

func (p Paths) Remove(paths ...string) Paths

Remove returns a new path object that doesn't contain any of the specified paths.

func (Paths) String added in v0.0.4

func (p Paths) String() string

Creates a new path string, where all entries are quoted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL