Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubResolver ¶
GitHubResolver resolves github:topic/<topic> meta-sources via the GitHub API.
func NewGitHubResolver ¶
func NewGitHubResolver(client *github.Client) *GitHubResolver
func NewGitHubResolverUnauthenticated ¶
func NewGitHubResolverUnauthenticated() *GitHubResolver
NewGitHubResolverUnauthenticated creates an unauthenticated resolver (lower rate limits).
func NewGitHubResolverWithToken ¶
func NewGitHubResolverWithToken(token string) *GitHubResolver
NewGitHubResolverWithToken creates a resolver authenticated with a personal access token.
func (*GitHubResolver) Handles ¶
func (r *GitHubResolver) Handles(source string) bool
func (*GitHubResolver) Resolve ¶
func (r *GitHubResolver) Resolve(source string) ([]ResolvedRepo, error)
type ResolvedRepo ¶
type ResolvedRepo struct {
URL string // git clone URL
Branch string // branch to fetch from
Origin string // how this repo was discovered (e.g. "explicit", "github:topic/vctm")
Organization string // explicit organization label (empty = infer from URL)
}
ResolvedRepo is a concrete git repository to fetch credential data from.
func ResolveAll ¶
func ResolveAll(manifest *SourceManifest, resolvers []Resolver) ([]ResolvedRepo, error)
ResolveAll resolves all sources in a manifest into concrete repos using the provided resolvers. Explicit git: entries are resolved directly. Duplicate repos (same URL) are deduplicated, with explicit entries taking precedence over meta-source results.
type Resolver ¶
type Resolver interface {
// Resolve takes a meta-source URI and returns the repos it resolves to.
Resolve(source string) ([]ResolvedRepo, error)
// Handles returns true if this resolver can handle the given source URI scheme.
Handles(source string) bool
}
Resolver resolves meta-sources into concrete repos.
type SourceDefaults ¶
type SourceDefaults struct {
Branch string `yaml:"branch"`
}
SourceDefaults contains default settings applied to all resolved repos.
type SourceEntry ¶ added in v0.7.0
type SourceEntry struct {
URL string `yaml:"url"`
Organization string `yaml:"organization,omitempty"`
Branch string `yaml:"branch,omitempty"`
}
SourceEntry represents a source in the manifest. It can be either a plain string URI or a struct with explicit organization and branch overrides.
Plain string:
sources: - "git:https://github.com/org/repo.git"
Struct with organization and branch:
sources:
- url: "git:https://github.com/org/repo.git"
organization: "MyOrg"
branch: "vctm"
func (*SourceEntry) UnmarshalYAML ¶ added in v0.7.0
func (s *SourceEntry) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML allows SourceEntry to be parsed from either a plain string or a mapping with url and organization fields.
type SourceManifest ¶
type SourceManifest struct {
Sources []SourceEntry `yaml:"sources"`
Defaults SourceDefaults `yaml:"defaults"`
}
SourceManifest is the top-level structure of a sources.yaml file.
func LoadManifest ¶
func LoadManifest(path string) (*SourceManifest, error)
LoadManifest reads and parses a sources.yaml file.