Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BucketKey is the name of the bucket where aliases are stored BucketKey = "alias" // ErrorNotFound will be thrown if the alias can not be found ErrorNotFound = errors.New("Alias not found") // ErrorNoName will be thrown if the alias has no name ErrorNoName = errors.New("An alias has no name") // ErrorDuplicateAlias will be thrown if there is already an alias with that name ErrorDuplicateAlias = errors.New("The alias already exist") // ErrorFileAlreadyPresent will be thrown if the symlink cannot be created due to an existing file with the same name ErrorFileAlreadyPresent = errors.New("The symlink could not be created because there is already a file with that name") // ErrorNaughtyBoy will be thrown it the user tries to install a tool with the slh alias ErrorNaughtyBoy = errors.New("It is not recommended to alias any tool with 'slh'...") )
Functions ¶
func CreateSymlink ¶
CreateSymlink will create the given symlink if possible
func HasSymlink ¶
HasSymlink will check if the given symlink is already present
func RemoveSymlink ¶
RemoveSymlink will remove the given symlink if possible
Types ¶
type Alias ¶
type Alias struct { Name string `json:"name"` Registry string `json:"registry"` Tool string `json:"tool"` Version string `json:"version"` }
Alias is a struct that will be used when the user installs a tool. That will create an alias that can be used as a shortcut.
type Aliases ¶
Aliases is the main access point for adding/removing/editing aliases
func New ¶
New will create a new Aliases struct based on the given bolt database. It offers methods to add/remove and list all aliases registered with Sledgehammer
func (*Aliases) Add ¶
Add will add the given alias to sledgehammer. It will overwrite any entry with the same name.
Click to show internal directories.
Click to hide internal directories.