config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 14 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 Alias added in v1.5.0

type Alias struct {
	Name string `json:"name"`
}

type Config

type Config struct {
	Packages   []*Package `validate:"dive" json:"packages"`
	Registries Registries `validate:"dive" json:"registries"`
}

type File

type File struct {
	Name string `validate:"required" json:"name,omitempty"`
	Src  string `json:"src,omitempty"`
}

func (*File) RenderSrc

func (file *File) RenderSrc(pkg *Package, pkgInfo *PackageInfo, rt *runtime.Runtime) (string, error)

type FormatOverride

type FormatOverride struct {
	GOOS   string `` /* 189-byte string literal not displayed */
	Format string `yaml:"format" json:"format" jsonschema:"example=tar.gz,example=raw"`
}

type Override

type Override struct {
	GOOS         string            `` /* 199-byte string literal not displayed */
	GOArch       string            `` /* 182-byte string literal not displayed */
	Replacements map[string]string `json:"replacements,omitempty"`
	Format       string            `json:"format,omitempty" jsonschema:"example=tar.gz,example=raw"`
	Asset        *string           `json:"asset,omitempty"`
	Files        []*File           `json:"files,omitempty"`
	URL          *string           `json:"url,omitempty"`
}

func (*Override) Match

func (ov *Override) Match(rt *runtime.Runtime) bool

type Package

type Package struct {
	Name     string `validate:"required" json:"name,omitempty"`
	Registry string `` /* 131-byte string literal not displayed */
	Version  string `validate:"required" yaml:",omitempty" json:"version,omitempty"`
	Import   string `yaml:",omitempty" json:"import,omitempty"`
}

func (*Package) UnmarshalYAML

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

type PackageInfo

type PackageInfo struct {
	Name               string             `json:"name,omitempty"`
	Type               string             `validate:"required" json:"type" jsonschema:"enum=github_release,enum=github_content,enum=github_archive,enum=http"`
	RepoOwner          string             `yaml:"repo_owner" json:"repo_owner,omitempty"`
	RepoName           string             `yaml:"repo_name" json:"repo_name,omitempty"`
	Asset              *string            `json:"asset,omitempty"`
	Path               *string            `json:"path,omitempty"`
	Format             string             `json:"format,omitempty" jsonschema:"example=tar.gz,example=raw"`
	Files              []*File            `json:"files,omitempty"`
	URL                *string            `json:"url,omitempty"`
	Description        string             `json:"description,omitempty"`
	Link               string             `json:"link,omitempty"`
	Replacements       map[string]string  `json:"replacements,omitempty"`
	Overrides          []*Override        `json:"overrides,omitempty"`
	FormatOverrides    []*FormatOverride  `yaml:"format_overrides" json:"format_overrides,omitempty"`
	VersionConstraints string             `yaml:"version_constraint" json:"version_constraint,omitempty"`
	VersionOverrides   []*VersionOverride `yaml:"version_overrides" json:"version_overrides,omitempty"`
	SupportedIf        *string            `yaml:"supported_if" json:"supported_if,omitempty"`
	VersionFilter      *string            `yaml:"version_filter" json:"version_filter,omitempty"`
	Rosetta2           *bool              `json:"rosetta2,omitempty"`
	Aliases            []*Alias           `json:"aliases,omitempty"`
}

func (*PackageInfo) GetAsset

func (pkgInfo *PackageInfo) GetAsset() *string

func (*PackageInfo) GetDescription

func (pkgInfo *PackageInfo) GetDescription() string

func (*PackageInfo) GetFileSrc

func (pkgInfo *PackageInfo) GetFileSrc(pkg *Package, file *File, rt *runtime.Runtime) (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, rt *runtime.Runtime) (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, rt *runtime.Runtime) (*PackageInfo, error)

func (*PackageInfo) RenderAsset

func (pkgInfo *PackageInfo) RenderAsset(pkg *Package, rt *runtime.Runtime) (string, error)

func (*PackageInfo) RenderURL

func (pkgInfo *PackageInfo) RenderURL(pkg *Package, rt *runtime.Runtime) (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) JSONSchema added in v1.4.0

func (Registries) JSONSchema() *jsonschema.Schema

func (*Registries) UnmarshalYAML

func (registries *Registries) UnmarshalYAML(unmarshal func(interface{}) error) error

type Registry

type Registry struct {
	Name      string `validate:"required" json:"name,omitempty"`
	Type      string `validate:"required" json:"type,omitempty" jsonschema:"enum=standard,enum=local,enum=github_content"`
	RepoOwner string `yaml:"repo_owner" json:"repo_owner,omitempty"`
	RepoName  string `yaml:"repo_name" json:"repo_name,omitempty"`
	Ref       string `json:"ref,omitempty"`
	Path      string `validate:"required" json:"path,omitempty"`
}

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" json:"packages"`
}

type RootDir

type RootDir string

func NewRootDir

func NewRootDir() RootDir

type VersionOverride added in v1.4.0

type VersionOverride struct {
	Type               string            `json:"type,omitempty" jsonschema:"enum=github_release,enum=github_content,enum=github_archive,enum=http"`
	RepoOwner          string            `yaml:"repo_owner" json:"repo_owner,omitempty"`
	RepoName           string            `yaml:"repo_name" json:"repo_name,omitempty"`
	Asset              *string           `json:"asset,omitempty"`
	Path               *string           `json:"path,omitempty"`
	Format             string            `json:"format,omitempty" jsonschema:"example=tar.gz,example=raw"`
	Files              []*File           `json:"files,omitempty"`
	URL                *string           `json:"url,omitempty"`
	Replacements       map[string]string `json:"replacements,omitempty"`
	Overrides          []*Override       `json:"overrides,omitempty"`
	FormatOverrides    []*FormatOverride `yaml:"format_overrides" json:"format_overrides,omitempty"`
	SupportedIf        *string           `yaml:"supported_if" json:"supported_if,omitempty"`
	VersionConstraints string            `yaml:"version_constraint" json:"version_constraint,omitempty"`
	VersionFilter      *string           `yaml:"version_filter" json:"version_filter,omitempty"`
	Rosetta2           *bool             `json:"rosetta2,omitempty"`
}

Jump to

Keyboard shortcuts

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