Documentation ¶
Index ¶
- Constants
- func AddChildrenFlag(cmd *cobra.Command)
- func AddGroupFlag(cmd *cobra.Command)
- func AddPolicyFileFlag(cmd *cobra.Command)
- func AddRepositoriesFileFlag(cmd *cobra.Command)
- func Execute()
- func WardenRepo(repo *vcsurl.Repository, tags []string) *wardenRepo
- func WardenRepos(repoDefs []RepositoryDefinition) ([]*wardenRepo, error)
- type PolicyFile
- type RepositoriesFile
- type RepositoryDefinition
- type RepositoryGroup
Constants ¶
const ( ERR_ACCESS_EXTRA = "The user/team '%s' is present and shouldn't be." ERR_ACCESS_MISSING = "The user/team %s is not defined." ERR_ACCESS_DIFFERENT = "The user/team '%s' should have the permission '%s', not '%s'." ERR_ACCESS_STRATEGY = "'%s' is not a valid access strategy." ERR_BRANCH_DEFAULT = "The default branch should be '%s', not '%s'." ERR_LABEL_EXTRA = "The label '%s' is present and shouldn't be." ERR_LABEL_MISSING = "The label '%s' is missing." ERR_LICENSE_DIFFERENT = "The license should be one of '%s', not '%s'." ERR_LICENSE_MISSING = "The license is missing." ERR_CO_DIFFERENT = "The CODEOWNERS file is different from the policy." ERR_CO_MISSING = "The CODEOWNERS file is missing." ERR_CO_SYNTAX = "The CODEOWNERS file has syntax errors:\n%s" )
Variables ¶
This section is empty.
Functions ¶
func AddChildrenFlag ¶ added in v0.8.0
func AddGroupFlag ¶ added in v0.8.0
func AddPolicyFileFlag ¶ added in v0.5.0
func AddRepositoriesFileFlag ¶ added in v0.5.0
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately.
func WardenRepo ¶ added in v0.10.0
func WardenRepo(repo *vcsurl.Repository, tags []string) *wardenRepo
Create a new WardenRepo
func WardenRepos ¶ added in v0.10.0
func WardenRepos(repoDefs []RepositoryDefinition) ([]*wardenRepo, error)
Create a slice of new WardenRepos from RepoDefs
Types ¶
type PolicyFile ¶ added in v0.5.0
type PolicyFile struct { DefaultBranch string `yaml:"defaultBranch"` Archived bool `yaml:"archived"` // include archived repos in lookup? License *licensePolicy `yaml:"license"` Labels []string `yaml:"labels"` LabelStrategy string `yaml:"labelStrategy"` Access []accessPolicy `yaml:"access"` Codeowners []codeownersPolicy `yaml:"codeowners"` }
The top-level structure representing a policy.yml file.
type RepositoriesFile ¶ added in v0.6.0
type RepositoriesFile []*RepositoryGroup
============================================================================= A repositories.yml file =============================================================================
func (RepositoriesFile) Group ¶ added in v0.6.0
func (this RepositoriesFile) Group(groupName string) (*RepositoryGroup, error)
Get a group from a repositories file.
func (*RepositoriesFile) RepositoriesByGroup ¶ added in v0.6.0
func (this *RepositoriesFile) RepositoriesByGroup(group string) []RepositoryDefinition
Gets repositories from a repositories.yml file by group. The only group supported at this time is 'all'.
type RepositoryDefinition ¶ added in v0.5.0
type RepositoryGroup ¶ added in v0.6.0
type RepositoryGroup struct { Group string `yaml:"group"` Repositories []RepositoryDefinition `yaml:"repositories"` Children RepositoriesFile `yaml:"children,omitempty"` }
============================================================================= A list of repositories belonging to a group, the top-level object in a repositories.yml file. =============================================================================
func (*RepositoryGroup) Add ¶ added in v0.6.0
func (this *RepositoryGroup) Add(repoDef RepositoryDefinition)
Add a repository to the group
func (*RepositoryGroup) GetRepositories ¶ added in v0.8.0
func (this *RepositoryGroup) GetRepositories(listChildren bool) []RepositoryDefinition
Returns the repositories belong to the group. The parameter decides if to include children or not.
func (*RepositoryGroup) HasChildren ¶ added in v0.6.0
func (this *RepositoryGroup) HasChildren() bool
func (*RepositoryGroup) ListRepositories ¶ added in v0.8.0
func (this *RepositoryGroup) ListRepositories(listChildren bool) []string
Returns the list of URLs for each repository in this group. The parameter decides if to include children or not.