Documentation ¶
Index ¶
- func BottleFileName(f PlatformFormula) string
- func Names[T Namer](formulae []T) []string
- func PkgVersion(v Version) string
- func Tag(v Version) string
- type Bottle
- type ConcurrentFormulary
- type ConcurrentPlatformFormulary
- type ConcurrentSearchableFormulary
- type Conflict
- type DependencyTags
- type Formula
- type Formulary
- type GitSource
- type Info
- type MultiPlatformFormula
- type NameLister
- type NameVersioner
- type Namer
- type PlatformFormula
- func FetchAllPlatform(ctx context.Context, src Formulary, names []string, plat platform.Platform) ([]PlatformFormula, error)
- func FetchPlatform(ctx context.Context, src Formulary, name string, plat platform.Platform) (PlatformFormula, error)
- func PlatformFromV1(plat platform.Platform, input *brewv1.PlatformInfo) PlatformFormula
- type PlatformFormulary
- type RubySource
- type SearchableFormulary
- type SourceInfo
- type TaggedDependencies
- type V1
- type Version
- type Versioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BottleFileName ¶
func BottleFileName(f PlatformFormula) string
BottleFileName returns a short name for the downloaded bottle .tar.gz file for the formula.
Pattern:
NAME--VERSION[_REVISION][-REBUILD]
Example:
cowsay--3.04_1.arm64_sonoma.bottle.tar.gz
func PkgVersion ¶
PkgVersion is a helper for producing the package version.
Types ¶
type Bottle ¶
type Bottle struct { RootURL string Sha256 string Cellar string Platform platform.Platform // stores Bottle platform, which can vary from PlatformFormula.Platform() iff the Bottle is for "all" platforms. }
Bottle defines bottle metadata.
type ConcurrentFormulary ¶
type ConcurrentFormulary interface { Formulary FetchFormulae(ctx context.Context, names []string) ([]MultiPlatformFormula, error) }
ConcurrentFormulary is a source of Formulae that supports concurrent fetching.
type ConcurrentPlatformFormulary ¶
type ConcurrentPlatformFormulary interface { PlatformFormulary ConcurrentFormulary FetchPlatformFormulae(ctx context.Context, names []string, plat platform.Platform) ([]PlatformFormula, error) }
ConcurrentFormulary is a source of Formulae that supports platform metadata and concurrent fetching.
type ConcurrentSearchableFormulary ¶
type ConcurrentSearchableFormulary interface { ConcurrentFormulary NameLister }
SearchableFormulary is a Formulary that supports search and concurrent fetching.
type DependencyTags ¶
type DependencyTags struct { IncludeBuild bool IncludeTest bool SkipRecommended bool IncludeOptional bool }
DependencyTags defines the available dependency tags.
func (*DependencyTags) LogAttr ¶
func (deps *DependencyTags) LogAttr() slog.Attr
LogAttr formats the tags as a slog.Attr.
type Formula ¶
type Formula interface { NameVersioner // Info produces basic information about the Formula. Info() *Info }
Formula represents a Homebrew Formula.
type Formulary ¶
type Formulary interface {
FetchFormula(ctx context.Context, name string) (MultiPlatformFormula, error)
}
Formulary is a source of Formulae.
type MultiPlatformFormula ¶
type MultiPlatformFormula interface { Formula // ForPlatform produces a PlatformFormula for the given platform. ForPlatform(plat platform.Platform) (PlatformFormula, error) }
MultiPlatformFormula is implemented by formulae that support multiple platforms.
func FromV1 ¶
func FromV1(input *brewv1.Info) MultiPlatformFormula
FromV1 produces a Formula from v1 API input.
type NameLister ¶
NameLister is implemented by searchable Formularies.
type NameVersioner ¶
NameVersioner is implemented by all Formula types.
type PlatformFormula ¶
type PlatformFormula interface { Formula // Platform produces the platform for this Formula. Platform() platform.Platform // SourceInfo produces information about the Formula's source. SourceInfo() *SourceInfo // Caveats produces the Formula's caveats, if any. Caveats() string // Dependencies lists dependencies on other Formulae. Dependencies() *TaggedDependencies // SystemDependencies lists dependencies on system software. SystemDependencies() *TaggedDependencies // Conflicts lists conflicts with other formulae. Conflicts() []Conflict // LinkOverwrite lists links to be overwritten in the prefix. LinkOverwrite() []string // IsKegOnly reports whether the Formula is keg-only. IsKegOnly() bool // KegOnlyReason produces the reason why a Formula is keg-only. KegOnlyReason() (reason string) // Requirements lists other system requirements. // Requirements() []any // Service produces the Formula's service, if any. Service() *brewv1.Service // Bottle produces information about the Formula's Bottle. // Bottle will return nil if the Formula does not provide a Bottle. Bottle() *Bottle }
PlatformFormula represents a Homebrew Formula for a specific platform.
func FetchAllPlatform ¶
func FetchAllPlatform(ctx context.Context, src Formulary, names []string, plat platform.Platform) ([]PlatformFormula, error)
FetchAllPlatform fetches PlatformFormulae from the Formulary.
func FetchPlatform ¶
func FetchPlatform(ctx context.Context, src Formulary, name string, plat platform.Platform) (PlatformFormula, error)
FetchPlatform fetches a PlatformFormula from the Formulary.
func PlatformFromV1 ¶
func PlatformFromV1(plat platform.Platform, input *brewv1.PlatformInfo) PlatformFormula
PlatformFromV1 creates a Formula from v1 API input.
type PlatformFormulary ¶
type PlatformFormulary interface { Formulary FetchPlatformFormula(ctx context.Context, name string, plat platform.Platform) (PlatformFormula, error) }
PlatformFormulary is a source of Formulae that supports platform metadata.
type RubySource ¶
RubySource defines the Ruby source for a Formula.
type SearchableFormulary ¶
type SearchableFormulary interface { Formulary NameLister }
SearchableFormulary is a Formulary that supports search.
type SourceInfo ¶
type SourceInfo struct { URL string Using string Checksum string Git GitSource Ruby RubySource }
SourceInfo defines source information for a Formula.
type TaggedDependencies ¶
type TaggedDependencies struct { Required []string Build []string Test []string Recommended []string Optional []string }
TaggedDependencies stores dependencies in lists by tag.
func (*TaggedDependencies) ForTags ¶
func (deps *TaggedDependencies) ForTags(tags *DependencyTags) []string
ForTags implements Dependencies.
type V1 ¶
type V1 struct {
// contains filtered or unexported fields
}
V1 implements Formula for v1 API output.
func (*V1) ForPlatform ¶
func (f *V1) ForPlatform(plat platform.Platform) (PlatformFormula, error)
ForPlatform implements MultiPlatformFormula.