Documentation
¶
Index ¶
- Variables
- type Dependency
- type GPM
- func (gpm GPM) GetBinPath() (string, error)
- func (gpm GPM) GetHomePath() (string, error)
- func (gpm GPM) GetStorePath() (string, error)
- func (gpm GPM) InstallDependency(ctx context.Context, dep Dependency, progressTracker getter.ProgressTracker) error
- func (gpm GPM) ListDownloadedDependencies(ctx context.Context) ([]Dependency, error)
- func (gpm GPM) ListLinkedDependencies(ctx context.Context) ([]LinkedDependencies, error)
- type GPMOption
- type LinkedDependencies
Constants ¶
This section is empty.
Variables ¶
var RegexpDependency = regexp.MustCompile(`^((?P<owner>[^/]+)/)?(?P<repo>[a-zA-Z-_.]+)(@(?P<tag>[^:]*))?(:(?P<assets>.*))?$`)
RegexpDependency is used to parse dependencies from raw strings.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
Dependency represents a release asset from a Github repository.
func ConvertDependenciesStrings ¶
func ConvertDependenciesStrings(s ...string) ([]Dependency, error)
ConvertDependenciesStrings parses raw strings with RegexpDependency.
func (Dependency) String ¶
func (dep Dependency) String() string
type GPM ¶
type GPM struct {
// contains filtered or unexported fields
}
GPM holds the common configurations to manage Dependency.
func (GPM) GetBinPath ¶
GetBinPath returns bin directory. See WithBinPath.
func (GPM) GetHomePath ¶
GetHomePath returns the user home directory. See WithHomePath.
func (GPM) GetStorePath ¶
GetStorePath returns the store directory. See WithStorePath.
func (GPM) InstallDependency ¶
func (gpm GPM) InstallDependency(ctx context.Context, dep Dependency, progressTracker getter.ProgressTracker) error
func (GPM) ListDownloadedDependencies ¶
func (gpm GPM) ListDownloadedDependencies(ctx context.Context) ([]Dependency, error)
func (GPM) ListLinkedDependencies ¶
func (gpm GPM) ListLinkedDependencies(ctx context.Context) ([]LinkedDependencies, error)
type GPMOption ¶
type GPMOption func(*GPM)
GPMOption is used to set options on GPM. GPM can accept a variable number of options.
func WithBinPath ¶
WithBinPath sets the path where symlinks to executables will be created. Defaults to ~/.local/bin.
func WithHomePath ¶
WithHomePath sets the home path that is used when initializing default paths (eg. GPM.GetBinPath). Defaults to ~/.
func WithStorePath ¶
WithStorePath sets the path prefix where the releases assets will be downloaded. Defaults to ~/.local/share/gpm.
type LinkedDependencies ¶
type LinkedDependencies struct {
Src, Dst string
}