Documentation ¶
Overview ¶
Package repositories provides types and tools to deal with Giant Swarm's repository configuration data maintained in https://github.com/giantswarm/github/tree/master/repositories
Index ¶
- func IsFileNotFoundError(err error) bool
- type Config
- type GithubReleaseDetails
- type GithubRepoContentDetails
- type GithubRepoDetails
- type ListResult
- type Repo
- type RepoFlavor
- type RepoGen
- type RepoLanguage
- type RepoLifecycle
- type RepoReplacements
- type Sbom
- type SbomPackage
- type SbomPayload
- type Service
- func (s *Service) GetDependencies(name string) ([]string, error)
- func (s *Service) GetHasCircleCI(name string) (bool, error)
- func (s *Service) GetHasReadme(name string) (bool, error)
- func (s *Service) GetHelmChartNames(name string) ([]string, error)
- func (s *Service) GetIsPrivate(name string) (bool, error)
- func (s *Service) GetLists() ([]ListResult, error)
- func (s *Service) GetNumHelmCharts(name string) (int, error)
- func (s *Service) LoadGitHubFile(name string, path string) (string, error)
- func (s *Service) MustGetDefaultBranch(name string) string
- func (s *Service) MustGetDescription(name string) string
- func (s *Service) MustGetLanguage(name string) string
- func (s *Service) MustGetLatestReleaseTag(name string) (string, error)
- func (s *Service) MustGetLatestReleaseTime(name string) (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFileNotFoundError ¶ added in v0.12.0
IsFileNotFoundError returns true if error is fileNotFoundError.
Types ¶
type Config ¶ added in v0.0.4
type Config struct { // Name of the GitHub organization owning our repository. GithubOrganization string // Name of the repository containing our repositories config. GithubRepositoryName string // Github personal access token (PTA) to use for client authentication. GithubAuthToken string // Path within the repository containing repository config YAML lists. // An empty string indicates the root directory. DirectoryPath string }
type GithubReleaseDetails ¶ added in v0.11.0
type GithubReleaseDetails struct { // Creation date/time of the latest release. LatestReleaseTime time.Time // Tag name of the latest release. LatestReleaseTag string }
Cache for info on releases of a repo.
type GithubRepoContentDetails ¶ added in v0.0.7
type GithubRepoContentDetails struct { // Whether the repository has a CircleCI configuration file. HasCircleCI bool // Whether the repository has a README.md in the root directory. HasReadme bool // Whether the repository has a "helm" folder in the root directory. HasHelmFolder bool NumHelmCharts int HelmChartNames []string }
A struct for caching repository content information.
type GithubRepoDetails ¶ added in v0.0.7
type GithubRepoDetails struct { // Repository name Name string // Repository description Description string // Name of the default branch DefaultBranch string // Whether the repository is private. If false, it's public. IsPrivate bool // The main programming language in the repo. MainLanguage string }
A sparse struct for caching just the GitHub repository details we need.
type ListResult ¶
type Repo ¶
type Repo struct { Name string `yaml:"name"` ComponentType string `yaml:"componentType"` DeploymentNames []string `yaml:"deploymentNames"` System string `yaml:"system"` Gen RepoGen `yaml:"gen"` Lifecycle RepoLifecycle `yaml:"lifecycle"` Replacements RepoReplacements `yaml:"replace"` AppTestSuite interface{} `yaml:"app_test_suite"` }
Repo represents an entry in the giantswarm/github repositories YAML data.
type RepoFlavor ¶
type RepoFlavor string
const ( RepoFlavorApp RepoFlavor = "app" RepoFlavorCLI RepoFlavor = "cli" RepoFlavorGeneric RepoFlavor = "generic" )
type RepoGen ¶
type RepoGen struct { Flavors []RepoFlavor `yaml:"flavours"` Language RepoLanguage `yaml:"language"` InstallUpdateChart bool `yaml:"installUpdateChart"` EnableFloatingMajorTags bool `yaml:"enableFloatingMajorTags"` }
type RepoLanguage ¶
type RepoLanguage string
const ( RepoLanguageGo RepoLanguage = "go" RepoLanguagePython RepoLanguage = "python" RepoLanguageGeneric RepoLanguage = "generic" )
type RepoLifecycle ¶
type RepoLifecycle string
type RepoReplacements ¶
type Sbom ¶ added in v0.1.0
type Sbom struct { Name string `json:"name"` Packages []SbomPackage `json:"packages"` }
type SbomPackage ¶ added in v0.1.0
type SbomPackage struct {
Name string `json:"name"`
}
type SbomPayload ¶ added in v0.1.0
type SbomPayload struct {
Sbom Sbom `json:"sbom"`
}
type Service ¶ added in v0.0.4
type Service struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.0.4
New instantiates a new repositories service.
This results in the fetching of basic data on all repositories owned by the organization, issuing one request per 100 repositories. Beware of rate limiting!
func (*Service) GetDependencies ¶ added in v0.1.0
Returns list of dependencies.
func (*Service) GetHasCircleCI ¶ added in v0.0.7
Returns whether the repo has a CircleCI configuration.
func (*Service) GetHasReadme ¶ added in v0.0.7
Returns whether the repo has a main README file.
func (*Service) GetHelmChartNames ¶ added in v0.12.0
Returns the name(s) of the repo's Helm chart(s).
func (*Service) GetIsPrivate ¶ added in v0.0.6
Returns the public/private info for the given repo.
func (*Service) GetLists ¶ added in v0.0.4
func (s *Service) GetLists() ([]ListResult, error)
GetLists loads the lists of repository YAML files from GitHub giantswarm/github.
func (*Service) GetNumHelmCharts ¶ added in v0.12.0
Returns whether the repo has a Helm chart.
func (*Service) LoadGitHubFile ¶ added in v0.12.0
Return the content of a source file in a repository as string.
func (*Service) MustGetDefaultBranch ¶ added in v0.0.7
Returns the default branch name. Returns an empty string in case of error.
func (*Service) MustGetDescription ¶ added in v0.0.7
Returns the description for the given repo. If not available, or an error occurs, returns an empty string.
func (*Service) MustGetLanguage ¶ added in v0.1.0
Returns the main language for the given repo. If not available, or an error occurs, returns an empty string.
func (*Service) MustGetLatestReleaseTag ¶ added in v0.11.0
Returns the tag of the repository's most recent release. If no release was found, returns empty string.