Documentation
¶
Index ¶
- type AppContext
- type Coord
- type ExecContext
- type FuzzyConfigContent
- type FuzzyCoord
- type LockedConfigContent
- type LockedCoord
- type PreRunCtx
- type ResolvedDependency
- type Triggers
- type UserConfig
- type UserConfigIon
- type UserConfigServer
- type Version
- func (o *Version) Canonical() string
- func (o *Version) Compare(v Version) int
- func (o *Version) MarshalIon(w ion.Writer) error
- func (o *Version) MarshalJSON() ([]byte, error)
- func (o *Version) Original() string
- func (o *Version) String() string
- func (o *Version) UnmarshalIon(r ion.Reader) error
- func (o *Version) UnmarshalJSON(data []byte) error
- type VersionPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppContext ¶
type AppContext struct {
AppName string
LockFileName string
HomeDir string
UserDir string
UserConfigFileName string
UserCacheDirName string
ConfigFileNames []string
UserConfig UserConfig
}
func NewDefaultAppContext ¶
func NewDefaultAppContext() *AppContext
type Coord ¶
type Coord interface {
CanonicalNameNoVersion() string
// contains filtered or unexported methods
}
type ExecContext ¶
type ExecContext struct {
Sub []ExecContext
Alias map[string]string
// contains filtered or unexported fields
}
func (*ExecContext) Env ¶
func (o *ExecContext) Env() map[string]string
func (*ExecContext) ResolveAlias ¶
func (o *ExecContext) ResolveAlias(args []string) []string
func (*ExecContext) Set ¶
func (o *ExecContext) Set(k, v string) *ExecContext
func (*ExecContext) SetPath ¶
func (o *ExecContext) SetPath(path []string)
type FuzzyConfigContent ¶
type FuzzyConfigContent struct {
BinDir string `ion:"binDir" json:"binDir" hcl:"binDir,optional"`
Deps []string `ion:"deps" json:"deps" hcl:"deps,optional"`
Export map[string]string `ion:"env" json:"env" hcl:"env,optional"`
Alias map[string]string `ion:"alias" json:"alias" hcl:"alias,optional"`
Triggers *Triggers `ion:"triggers" json:"triggers,omitempty" hcl:"triggers,block"`
Remain hcl.Body `ion:"-" json:"-" hcl:",remain"`
}
func FuzzyConfigContentFromFile ¶
func FuzzyConfigContentFromFile(f string) (*FuzzyConfigContent, error)
func (*FuzzyConfigContent) String ¶
func (c *FuzzyConfigContent) String() string
type FuzzyCoord ¶
type FuzzyCoord struct {
OriginalString string // original string
Server string // github.com | local.local
Owner string // rhamerica
Repo string // myrepo
Version string // no v
}
func NewCoordFromStr ¶
func NewCoordFromStr(depStr string) (*FuzzyCoord, error)
func (*FuzzyCoord) CanonicalNameNoVersion ¶
func (d *FuzzyCoord) CanonicalNameNoVersion() string
func (*FuzzyCoord) String ¶
func (d *FuzzyCoord) String() string
type LockedConfigContent ¶
type LockedConfigContent struct {
BinDir string `ion:"binDir" json:"binDir,omitempty"`
Deps []*LockedCoord `ion:"deps" json:"deps,omitempty"`
Export map[string]string `ion:"env" json:"env,omitempty"`
Alias map[string]string `ion:"alias" json:"alias,omitempty"`
Triggers Triggers `ion:"triggers" json:"triggers,omitempty"`
}
func LockedConfigContentFromFile ¶
func LockedConfigContentFromFile(f string) (*LockedConfigContent, error)
type LockedCoord ¶
type LockedCoord struct {
Server string `ion:"server" json:"server"`
Owner string `ion:"owner" json:"owner"`
Repo string `ion:"repo" json:"repo"`
Version Version `ion:"version" json:"version"` // no v
}
func (*LockedCoord) CanonicalNameNoVersion ¶
func (d *LockedCoord) CanonicalNameNoVersion() string
func (*LockedCoord) String ¶
func (o *LockedCoord) String() string
type ResolvedDependency ¶
type ResolvedDependency struct {
Coord LockedCoord
Dir string // directory where it is extracted
BinDir string // directory where binaries are extracted
Exports map[string]string // environment vars
Alias map[string]string // aliases
Triggers Triggers // triggers
Sub []*ResolvedDependency // Sub Dependencies
}
func (*ResolvedDependency) BinDirOrDefault ¶
func (ed *ResolvedDependency) BinDirOrDefault() string
func (*ResolvedDependency) Resolve ¶
func (ed *ResolvedDependency) Resolve() *ExecContext
Resolve returns a slice with bin dirs to be prepended to PATH os var and a map with all environment variables to be added. It resolves all of these values recursevily
type Triggers ¶
type Triggers struct {
InstallScript string `ion:"installScript" json:"installScript,omitempty" hcl:"installScript,optional"`
PreRunScript string `ion:"preRunScript" json:"preRunScript,omitempty" hcl:"preRunScript,optional"`
Remain hcl.Body `ion:"-" json:"-" hcl:",remain"`
}
func (*Triggers) RunInstallScript ¶
func (o *Triggers) RunInstallScript(lcc *LockedConfigContent) error
type UserConfig ¶
type UserConfig struct {
Servers []UserConfigServer `ion:"server" hcl:"server,block"`
}
server "github.com" {
token: "abcde..."
}
------------
{
server: {
"github.com": {
token: "abcde..."
}
}
}
func NewUserConfigFromFile ¶
func NewUserConfigFromFile(f string) (*UserConfig, error)
func (*UserConfig) GetServerToken ¶
func (o *UserConfig) GetServerToken(serverName string) string
type UserConfigIon ¶
type UserConfigIon struct {
Servers map[string]UserConfigServer `ion:"server"`
}
type UserConfigServer ¶
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
func NewVersion ¶
func (*Version) MarshalJSON ¶
func (*Version) UnmarshalJSON ¶
type VersionPattern ¶
type VersionPattern struct {
// contains filtered or unexported fields
}
func NewVersionPattern ¶
func NewVersionPattern(s string) VersionPattern
func (*VersionPattern) Matches ¶
func (o *VersionPattern) Matches(v Version) bool
Click to show internal directories.
Click to hide internal directories.