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) 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 GitHubContentRegistry
- type GitHubRepositoryService
- type LocalRegistry
- type MergedPackageInfo
- func (pkgInfo *MergedPackageInfo) GetDescription() string
- func (pkgInfo *MergedPackageInfo) GetFileSrc(pkg *Package, file *File) (string, error)
- func (pkgInfo *MergedPackageInfo) GetFiles() []*File
- func (pkgInfo *MergedPackageInfo) GetFormat() string
- func (pkgInfo *MergedPackageInfo) GetLink() string
- func (pkgInfo *MergedPackageInfo) GetName() string
- func (pkgInfo *MergedPackageInfo) GetPkgPath(rootDir string, pkg *Package) (string, error)
- func (pkgInfo *MergedPackageInfo) GetReplacements() map[string]string
- func (pkgInfo *MergedPackageInfo) GetType() string
- func (pkgInfo *MergedPackageInfo) HasRepo() bool
- func (pkgInfo *MergedPackageInfo) RenderAsset(pkg *Package) (string, error)
- func (pkgInfo *MergedPackageInfo) SetVersion(v string) (*MergedPackageInfo, error)
- type Package
- type PackageDownloader
- type PackageInfos
- type Param
- type Registries
- type Registry
- type RegistryContent
- type Template
- type Unarchiver
- type VersionConstraints
- 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"` InlineRegistry *RegistryContent `yaml:"inline_registry"` 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 Version string }
func (*Controller) Generate ¶
func (ctrl *Controller) Generate(ctx context.Context, param *Param) 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 *MergedPackageInfo 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 GitHubContentRegistry ¶
type GitHubContentRegistry struct { Name string `validate:"required"` RepoOwner string `yaml:"repo_owner"` RepoName string `yaml:"repo_name"` Ref string `validate:"required"` Path string `validate:"required"` }
func (*GitHubContentRegistry) GetFilePath ¶
func (registry *GitHubContentRegistry) GetFilePath(rootDir, cfgFilePath string) string
func (*GitHubContentRegistry) GetName ¶
func (registry *GitHubContentRegistry) GetName() string
func (*GitHubContentRegistry) GetType ¶
func (registry *GitHubContentRegistry) GetType() string
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) }
type LocalRegistry ¶
func (*LocalRegistry) GetFilePath ¶
func (registry *LocalRegistry) GetFilePath(rootDir, cfgFilePath string) string
func (*LocalRegistry) GetName ¶
func (registry *LocalRegistry) GetName() string
func (*LocalRegistry) GetType ¶
func (registry *LocalRegistry) GetType() string
type MergedPackageInfo ¶
type MergedPackageInfo 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 []*MergedPackageInfo `yaml:"version_overrides"` }
func (*MergedPackageInfo) GetDescription ¶
func (pkgInfo *MergedPackageInfo) GetDescription() string
func (*MergedPackageInfo) GetFileSrc ¶
func (pkgInfo *MergedPackageInfo) GetFileSrc(pkg *Package, file *File) (string, error)
func (*MergedPackageInfo) GetFiles ¶
func (pkgInfo *MergedPackageInfo) GetFiles() []*File
func (*MergedPackageInfo) GetFormat ¶
func (pkgInfo *MergedPackageInfo) GetFormat() string
func (*MergedPackageInfo) GetLink ¶
func (pkgInfo *MergedPackageInfo) GetLink() string
func (*MergedPackageInfo) GetName ¶
func (pkgInfo *MergedPackageInfo) GetName() string
func (*MergedPackageInfo) GetPkgPath ¶
func (pkgInfo *MergedPackageInfo) GetPkgPath(rootDir string, pkg *Package) (string, error)
func (*MergedPackageInfo) GetReplacements ¶
func (pkgInfo *MergedPackageInfo) GetReplacements() map[string]string
func (*MergedPackageInfo) GetType ¶
func (pkgInfo *MergedPackageInfo) GetType() string
func (*MergedPackageInfo) HasRepo ¶
func (pkgInfo *MergedPackageInfo) HasRepo() bool
func (*MergedPackageInfo) RenderAsset ¶
func (pkgInfo *MergedPackageInfo) RenderAsset(pkg *Package) (string, error)
func (*MergedPackageInfo) SetVersion ¶
func (pkgInfo *MergedPackageInfo) SetVersion(v string) (*MergedPackageInfo, 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 PackageDownloader ¶
type PackageDownloader interface {
GetReadCloser(ctx context.Context, pkg *Package, pkgInfo *MergedPackageInfo, assetName string) (io.ReadCloser, error)
}
type PackageInfos ¶
type PackageInfos []*MergedPackageInfo
func (*PackageInfos) ToMap ¶
func (pkgInfos *PackageInfos) ToMap() (map[string]*MergedPackageInfo, error)
type Registries ¶
type Registries []Registry
func (*Registries) UnmarshalYAML ¶
func (registries *Registries) UnmarshalYAML(unmarshal func(interface{}) error) error
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.