config

package
v1.3.0-0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PkgInfoTypeGitHubRelease = "github_release"
	PkgInfoTypeGitHubContent = "github_content"
	PkgInfoTypeGitHubArchive = "github_archive"
	PkgInfoTypeHTTP          = "http"
)
View Source
const (
	RegistryTypeGitHubContent = "github_content"
	RegistryTypeLocal         = "local"
	RegistryTypeStandard      = "standard"
)

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 File

type File struct {
	Name string `validate:"required"`
	Src  *template.Template
}

func (*File) RenderSrc

func (file *File) RenderSrc(pkg *Package, pkgInfo *PackageInfo) (string, error)

type FormatOverride

type FormatOverride struct {
	GOOS   string
	Format string `yaml:"format"`
}

type Override

type Override struct {
	GOOS         string
	GOArch       string
	Replacements map[string]string
	Format       string
	Asset        *template.Template
	Files        []*File
	URL          *template.Template
}

func (*Override) Match

func (ov *Override) Match() bool

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

func (pkg *Package) UnmarshalYAML(unmarshal func(interface{}) error) error

type PackageInfo

type PackageInfo struct {
	Name               string
	Type               string `validate:"required"`
	RepoOwner          string `yaml:"repo_owner"`
	RepoName           string `yaml:"repo_name"`
	Asset              *template.Template
	Path               *template.Template
	Format             string
	Files              []*File
	URL                *template.Template
	Description        string
	Link               string
	Replacements       map[string]string
	Overrides          []*Override
	FormatOverrides    []*FormatOverride              `yaml:"format_overrides"`
	VersionConstraints *constraint.VersionConstraints `yaml:"version_constraint"`
	VersionOverrides   []*PackageInfo                 `yaml:"version_overrides"`
	SupportedIf        *constraint.PackageCondition   `yaml:"supported_if"`
	VersionFilter      *constraint.VersionFilter      `yaml:"version_filter"`
	Rosetta2           *bool
}

func (*PackageInfo) GetAsset

func (pkgInfo *PackageInfo) GetAsset() *template.Template

func (*PackageInfo) GetDescription

func (pkgInfo *PackageInfo) GetDescription() string

func (*PackageInfo) GetFileSrc

func (pkgInfo *PackageInfo) GetFileSrc(pkg *Package, file *File) (string, error)

func (*PackageInfo) GetFiles

func (pkgInfo *PackageInfo) GetFiles() []*File

func (*PackageInfo) GetFormat

func (pkgInfo *PackageInfo) GetFormat() string
func (pkgInfo *PackageInfo) GetLink() string

func (*PackageInfo) GetName

func (pkgInfo *PackageInfo) GetName() string

func (*PackageInfo) GetPkgPath

func (pkgInfo *PackageInfo) GetPkgPath(rootDir string, pkg *Package) (string, error)

func (*PackageInfo) GetReplacements

func (pkgInfo *PackageInfo) GetReplacements() map[string]string

func (*PackageInfo) GetRosetta2

func (pkgInfo *PackageInfo) GetRosetta2() bool

func (*PackageInfo) GetType

func (pkgInfo *PackageInfo) GetType() string

func (*PackageInfo) HasRepo

func (pkgInfo *PackageInfo) HasRepo() bool

func (*PackageInfo) Override

func (pkgInfo *PackageInfo) Override(v string) error

func (*PackageInfo) RenderAsset

func (pkgInfo *PackageInfo) RenderAsset(pkg *Package) (string, error)

func (*PackageInfo) RenderURL

func (pkgInfo *PackageInfo) RenderURL(pkg *Package) (string, error)

func (*PackageInfo) Validate

func (pkgInfo *PackageInfo) Validate() error

type PackageInfos

type PackageInfos []*PackageInfo

func (*PackageInfos) ToMap

func (pkgInfos *PackageInfos) ToMap() (map[string]*PackageInfo, error)

type Param

type Param struct {
	ConfigFilePath string
	LogLevel       string
	OnlyLink       bool
	IsTest         bool
	All            bool
	Insert         bool
	File           string
	GlobalConfigs  []string
	AQUAVersion    string
}

type Registries

type Registries map[string]*Registry

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 *Registry) GetFilePath(rootDir, cfgFilePath string) string

func (*Registry) UnmarshalYAML

func (registry *Registry) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Registry) Validate

func (registry *Registry) Validate() error

type RegistryContent

type RegistryContent struct {
	PackageInfos PackageInfos `yaml:"packages" validate:"dive"`
}

type RootDir

type RootDir string

func NewRootDir

func NewRootDir() RootDir

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL