Documentation ¶
Index ¶
- Constants
- type Config
- type ConfigFinder
- type ConfigReader
- type Controller
- func (ctrl *Controller) Exec(ctx context.Context, param *Param, exeName string, args []string) error
- func (ctrl *Controller) Generate(ctx context.Context, param *Param, args ...string) error
- func (ctrl *Controller) Init(ctx context.Context, cfgFilePath string) error
- func (ctrl *Controller) Install(ctx context.Context, param *Param) error
- func (ctrl *Controller) List(ctx context.Context, param *Param, args []string) error
- func (ctrl *Controller) Which(ctx context.Context, param *Param, exeName string) error
- type Decompressor
- type File
- type FindingPackage
- type FormatOverride
- type Fsys
- type GitHubRepositoryService
- type Package
- type PackageCondition
- type PackageDownloader
- type PackageInfo
- func (pkgInfo *PackageInfo) GetDescription() string
- func (pkgInfo *PackageInfo) GetFileSrc(pkg *Package, file *File) (string, error)
- func (pkgInfo *PackageInfo) GetFiles() []*File
- func (pkgInfo *PackageInfo) GetFormat() string
- func (pkgInfo *PackageInfo) GetLink() string
- func (pkgInfo *PackageInfo) GetName() string
- func (pkgInfo *PackageInfo) GetPkgPath(rootDir string, pkg *Package) (string, error)
- func (pkgInfo *PackageInfo) GetReplacements() map[string]string
- func (pkgInfo *PackageInfo) GetRosetta2() bool
- func (pkgInfo *PackageInfo) GetType() string
- func (pkgInfo *PackageInfo) HasRepo() bool
- func (pkgInfo *PackageInfo) RenderAsset(pkg *Package) (string, error)
- func (pkgInfo *PackageInfo) SetVersion(v string) (*PackageInfo, error)
- type PackageInfos
- type Param
- type Registries
- type Registry
- type RegistryContent
- type Template
- type Unarchiver
- type VersionConstraints
- type VersionFilter
- type Which
Constants ¶
View Source
const OwnerExecutable os.FileMode = 64
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Packages []*Package `validate:"dive"` Registries Registries `validate:"dive"` }
type ConfigFinder ¶
type ConfigReader ¶
type ConfigReader interface {
Read(p string) (io.ReadCloser, error)
}
type Controller ¶
type Controller struct { Stdin io.Reader Stdout io.Writer Stderr io.Writer ConfigFinder ConfigFinder ConfigReader ConfigReader GitHubRepositoryService GitHubRepositoryService PackageDownloader PackageDownloader RootDir string GlobalConfingDir string Version string }
func (*Controller) Generate ¶
Generate searches packages in registries and outputs the configuration to standard output. If no package is specified, the interactive fuzzy finder is launched. If the package supports, the latest version is gotten by GitHub API.
func (*Controller) Init ¶ added in v0.8.7
func (ctrl *Controller) Init(ctx context.Context, cfgFilePath string) error
func (*Controller) Install ¶
func (ctrl *Controller) Install(ctx context.Context, param *Param) error
type Decompressor ¶
type Decompressor struct {
// contains filtered or unexported fields
}
type FindingPackage ¶
type FindingPackage struct { PackageInfo *PackageInfo RegistryName string }
type FormatOverride ¶
type Fsys ¶
type Fsys interface { Stat(string) (os.FileInfo, error) Lstat(string) (os.FileInfo, error) Chmod(string, os.FileMode) error Symlink(string, string) error Readlink(string) (string, error) Remove(string) error Getwd(string) (string, error) Open(string) (io.ReadCloser, error) OpenFile(string, os.FileMode) (io.WriteCloser, error) WriteFile(string, []byte, os.FileMode) error CreateTemp(string, string) (io.WriteCloser, error) }
type GitHubRepositoryService ¶
type GitHubRepositoryService interface { GetLatestRelease(ctx context.Context, repoOwner, repoName string) (*github.RepositoryRelease, *github.Response, error) GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) GetReleaseByTag(ctx context.Context, owner, repoName, version string) (*github.RepositoryRelease, *github.Response, error) DownloadReleaseAsset(ctx context.Context, owner, repoName string, assetID int64, httpClient *http.Client) (io.ReadCloser, string, error) ListReleases(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error) }
type Package ¶
type Package struct { Name string `validate:"required"` Registry string `validate:"required" yaml:",omitempty"` Version string `validate:"required" yaml:",omitempty"` Import string `yaml:",omitempty"` }
func (*Package) UnmarshalYAML ¶
type PackageCondition ¶ added in v0.8.1
type PackageCondition struct {
// contains filtered or unexported fields
}
func NewPackageCondition ¶ added in v0.8.1
func NewPackageCondition(s string) *PackageCondition
func (*PackageCondition) Check ¶ added in v0.8.1
func (pkgCondition *PackageCondition) Check() (bool, error)
func (*PackageCondition) Compile ¶ added in v0.8.1
func (pkgCondition *PackageCondition) Compile() error
func (*PackageCondition) Raw ¶ added in v0.8.1
func (pkgCondition *PackageCondition) Raw() string
func (*PackageCondition) UnmarshalYAML ¶ added in v0.8.1
func (pkgCondition *PackageCondition) UnmarshalYAML(unmarshal func(interface{}) error) error
type PackageDownloader ¶
type PackageDownloader interface {
GetReadCloser(ctx context.Context, pkg *Package, pkgInfo *PackageInfo, assetName string) (io.ReadCloser, error)
}
type PackageInfo ¶ added in v0.9.0
type PackageInfo struct { Name string Type string `validate:"required"` RepoOwner string `yaml:"repo_owner"` RepoName string `yaml:"repo_name"` Asset *Template Path *Template Format string Files []*File URL *Template Description string Link string Replacements map[string]string FormatOverrides []*FormatOverride `yaml:"format_overrides"` VersionConstraints *VersionConstraints `yaml:"version_constraint"` VersionOverrides []*PackageInfo `yaml:"version_overrides"` SupportedIf *PackageCondition `yaml:"supported_if"` VersionFilter *VersionFilter `yaml:"version_filter"` Rosetta2 *bool }
func (*PackageInfo) GetDescription ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetDescription() string
func (*PackageInfo) GetFileSrc ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetFileSrc(pkg *Package, file *File) (string, error)
func (*PackageInfo) GetFiles ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetFiles() []*File
func (*PackageInfo) GetFormat ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetFormat() string
func (*PackageInfo) GetLink ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetLink() string
func (*PackageInfo) GetName ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetName() string
func (*PackageInfo) GetPkgPath ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetPkgPath(rootDir string, pkg *Package) (string, error)
func (*PackageInfo) GetReplacements ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetReplacements() map[string]string
func (*PackageInfo) GetRosetta2 ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetRosetta2() bool
func (*PackageInfo) GetType ¶ added in v0.9.0
func (pkgInfo *PackageInfo) GetType() string
func (*PackageInfo) HasRepo ¶ added in v0.9.0
func (pkgInfo *PackageInfo) HasRepo() bool
func (*PackageInfo) RenderAsset ¶ added in v0.9.0
func (pkgInfo *PackageInfo) RenderAsset(pkg *Package) (string, error)
func (*PackageInfo) SetVersion ¶ added in v0.9.0
func (pkgInfo *PackageInfo) SetVersion(v string) (*PackageInfo, error)
type PackageInfos ¶
type PackageInfos []*PackageInfo
func (*PackageInfos) ToMap ¶
func (pkgInfos *PackageInfos) ToMap() (map[string]*PackageInfo, error)
type Registries ¶
func (*Registries) UnmarshalYAML ¶
func (registries *Registries) UnmarshalYAML(unmarshal func(interface{}) error) error
type Registry ¶
type Registry struct { Name string `validate:"required"` Type string `validate:"required"` RepoOwner string `yaml:"repo_owner"` RepoName string `yaml:"repo_name"` Ref string Path string `validate:"required"` }
func (*Registry) GetFilePath ¶
func (*Registry) UnmarshalYAML ¶ added in v0.9.0
type RegistryContent ¶
type RegistryContent struct {
PackageInfos PackageInfos `yaml:"packages" validate:"dive"`
}
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func (*Template) UnmarshalYAML ¶
type Unarchiver ¶
type VersionConstraints ¶
type VersionConstraints struct {
// contains filtered or unexported fields
}
func NewVersionConstraints ¶
func NewVersionConstraints(s string) *VersionConstraints
func (*VersionConstraints) Check ¶
func (constraints *VersionConstraints) Check(v string) (bool, error)
func (*VersionConstraints) Compile ¶
func (constraints *VersionConstraints) Compile() error
func (*VersionConstraints) UnmarshalYAML ¶
func (constraints *VersionConstraints) UnmarshalYAML(unmarshal func(interface{}) error) error
type VersionFilter ¶ added in v0.8.13
type VersionFilter struct {
// contains filtered or unexported fields
}
func NewVersionFilter ¶ added in v0.8.13
func NewVersionFilter(s string) *VersionFilter
func (*VersionFilter) Check ¶ added in v0.8.13
func (vf *VersionFilter) Check(v string) (bool, error)
func (*VersionFilter) Compile ¶ added in v0.8.13
func (vf *VersionFilter) Compile() error
func (*VersionFilter) Raw ¶ added in v0.8.13
func (vf *VersionFilter) Raw() string
func (*VersionFilter) UnmarshalYAML ¶ added in v0.8.13
func (vf *VersionFilter) UnmarshalYAML(unmarshal func(interface{}) error) error
Source Files ¶
- config.go
- controller.go
- download.go
- download_github.go
- download_url.go
- error.go
- exec.go
- finder.go
- fsys.go
- generate.go
- generate_insert.go
- init.go
- install.go
- install_packages.go
- install_proxy.go
- list.go
- lookpath.go
- package_condition.go
- package_info.go
- registry.go
- replacements.go
- template.go
- unarchive.go
- util.go
- validate.go
- version_constraint.go
- version_filter.go
- which.go
Click to show internal directories.
Click to hide internal directories.