Documentation ¶
Index ¶
- func InitConfig() appcontext.Component
- type Command
- type Config
- type ConfigRepository
- type Flag
- type GolangLibrary
- func (golangLibrary *GolangLibrary) BinPath() string
- func (golangLibrary *GolangLibrary) CachePath() string
- func (golangLibrary *GolangLibrary) InstalledVersion() (string, error)
- func (golangLibrary *GolangLibrary) ModPath() string
- func (golangLibrary *GolangLibrary) SrcPath() string
- func (golangLibrary *GolangLibrary) URLToPackage() string
- type RunCommandFunction
- type Spell
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct { Name string `json:"name"` ShortDescription string `json:"shortDescription"` LongDescription string `json:"longDescription"` Flags map[string]*Flag `json:"flags"` ValidArgs []string `json:"validArgs"` }
Command is an available command in a specific Spell (plugin)
func (*Command) CobraCommand ¶
func (command *Command) CobraCommand(runCommandFunction RunCommandFunction) *cobra.Command
CobraCommand creates a cobra.Command from the domain.Command specification
type Config ¶
type Config struct { Author string `json:"author"` License string `json:"license"` DefaultSpells []GolangLibrary `json:"defaultSpells"` Spellbook map[string]*Spell `json:"spellbook"` }
Config holds the Golangspell tool configuration
func BuildDefaultConfig ¶
func BuildDefaultConfig() Config
BuildDefaultConfig used to bootstrap application at first execution
type ConfigRepository ¶
type ConfigRepository interface { appcontext.Component Get() (*Config, error) Save(config *Config) (string, error) }
ConfigRepository defines the repository capabilities that should be found in a Repository implementation for Config
func GetConfigRepository ¶
func GetConfigRepository() ConfigRepository
GetConfigRepository from the Current Application Context
type Flag ¶
type Flag struct { Name string `json:"name"` Shorthand string `json:"shorthand"` Value string `json:"value"` Usage string `json:"usage"` }
Flag s defines special behaviors and configurations to the commands
type GolangLibrary ¶
GolangLibrary contains the deployment info of an installed Golang Library
func (*GolangLibrary) BinPath ¶
func (golangLibrary *GolangLibrary) BinPath() string
BinPath of the library
func (*GolangLibrary) CachePath ¶ added in v0.4.5
func (golangLibrary *GolangLibrary) CachePath() string
CachePath of the library
func (*GolangLibrary) InstalledVersion ¶ added in v0.4.6
func (golangLibrary *GolangLibrary) InstalledVersion() (string, error)
ModPath of the library
func (*GolangLibrary) ModPath ¶ added in v0.4.5
func (golangLibrary *GolangLibrary) ModPath() string
ModPath of the library
func (*GolangLibrary) SrcPath ¶
func (golangLibrary *GolangLibrary) SrcPath() string
SrcPath of the library
func (*GolangLibrary) URLToPackage ¶
func (golangLibrary *GolangLibrary) URLToPackage() string
URLToPackage returns the package name referenced by the URL
type RunCommandFunction ¶
RunCommandFunction specifies a function for running a command
type Spell ¶
type Spell struct { Name string `json:"name"` URL string `json:"url"` Commands map[string]*Command `json:"commands"` Installed bool `json:"installed"` Version string `json:"version"` }
Spell maps a Golangspell plugin
func (*Spell) URLToPackage ¶
URLToPackage returns the package name referenced by the URL