toolbox

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortNames = 0
	SortOrder = 1
)
View Source
const (
	AppName = "Toolbox"

	// registry keys
	DirectoryBackgroundShell = `Directory\Background\shell\`
	DirectoryShell           = `Directory\shell\`
	CommandStoreShell        = `SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\`

	// EntryLimit max limit for cascade menu
	EntryLimit = 16
)

Variables

This section is empty.

Functions

func DefaultToolboxDir added in v3.1.0

func DefaultToolboxDir() (string, error)

DefaultToolboxDir returns default toolbox installation directory.

func DeleteKey added in v3.1.0

func DeleteKey(key registry.Key, path string) error

DeleteKey delete a registry key and its sub keys.

func OpenOrCreateKey added in v3.1.0

func OpenOrCreateKey(key registry.Key, path string, access uint32) (registry.Key, error)

OpenOrCreateKey open a registry key, create it if it doesn't exist.

func ReadSubCommands

func ReadSubCommands() ([]string, bool, error)

ReadSubCommands returns current menu items

func SetItem added in v3.1.0

func SetItem(tool *Tool, admin bool) error

SetItem setItem add items to commandStore shell

func SetMenu added in v3.1.0

func SetMenu(dir string, items []string, top bool) error

func SetMenuItem added in v3.1.0

func SetMenuItem(path, display, command, subCommands string, top bool) error

SetMenuItem add menu to registry

func SortTools added in v3.1.0

func SortTools(tools []*Tool, sortType int)

Types

type Availability

type Availability int

func (Availability) String

func (a Availability) String() string

type Tool

type Tool struct {
	Id          string `json:"toolId"`
	Tag         string `json:"tag"`
	Name        string `json:"displayName"`
	Version     string `json:"displayVersion"`
	BuildNumber string `json:"buildNumber"`
	Channel     string `json:"channelId"`
	Location    string `json:"installLocation"`
	// exe
	Command string `json:"launchCommand"`
	// script file
	Script       string
	Availability Availability
	// contains filtered or unexported fields
}

Tool represents an IDE in ToolBox.

func FindLatestTool

func FindLatestTool(tools []*Tool) *Tool

FindLatestTool find the latest tool in a list of tools.

func FindTargetTools

func FindTargetTools(tools []*Tool, targets []string, all bool) []*Tool

FindTargetTools returns tools with specific names

type ToolBox

type ToolBox struct {
	Version string  `json:"AppVersion"`
	Tools   []*Tool `json:"tools"`

	ShellPath string
}

ToolBox is a struct to hold the toolbox state.

func GetAllTools

func GetAllTools(dir string) (*ToolBox, error)

GetAllTools return local tool list description

func GetLatestTools

func GetLatestTools(dir string, sortType int) (*ToolBox, error)

GetLatestTools returns latest tool list

func GetToolBoxState

func GetToolBoxState(dir string) (*ToolBox, error)

GetToolBoxState returns content of ToolBox/state.json

Jump to

Keyboard shortcuts

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