features

package
v0.0.0-...-50967a5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// RepoFeatureName is how mungers should indicate this is required
	RepoFeatureName = "gitrepos"
)

Variables

This section is empty.

Functions

func RegisterFeature

func RegisterFeature(feat feature) error

RegisterFeature should be called in `init()` by each feature to make itself available by name

Types

type Features

type Features struct {
	Repos *RepoInfo
	// contains filtered or unexported fields
}

Features are all features the code know about. Care should be taken not to try to use a feature which isn't 'active'

func (*Features) AddFlags

func (f *Features) AddFlags(cmd *cobra.Command) error

AddFlags allow every feature to add flags to the command

func (*Features) EachLoop

func (f *Features) EachLoop() error

EachLoop allows active features to update every loop

func (*Features) GetActive

func (f *Features) GetActive() []feature

GetActive returns all features requested by a munger

func (*Features) Initialize

func (f *Features) Initialize(requestedFeatures []string) error

Initialize should be called with the set of all features needed by all (active) mungers

type RepoInfo

type RepoInfo struct {
	// contains filtered or unexported fields
}

RepoInfo provides information about users in OWNERS files in a git repo

func (*RepoInfo) AddFlags

func (o *RepoInfo) AddFlags(cmd *cobra.Command)

AddFlags will add any request flags to the cobra `cmd`

func (*RepoInfo) Assignees

func (o *RepoInfo) Assignees(path string) sets.String

Assignees returns a set of users who are the closest assginees to the requested file. If pkg/OWNERS has user1 and pkg/util/OWNERS has user2 this will return both user1 and user2 for the path pkg/util/sets/file.go

func (*RepoInfo) EachLoop

func (o *RepoInfo) EachLoop() error

EachLoop is called at the start of every munge loop

func (*RepoInfo) GitCommand

func (o *RepoInfo) GitCommand(args []string) ([]byte, error)

GitCommand will execute the git command with the `args`

func (*RepoInfo) Initialize

func (o *RepoInfo) Initialize() error

Initialize will initialize the munger

func (*RepoInfo) LeafAssignees

func (o *RepoInfo) LeafAssignees(path string) sets.String

LeafAssignees returns a set of users who are the closest assginees to the requested file. If pkg/OWNERS has user1 and pkg/util/OWNERS has user2 this will only return user2 for the path pkg/util/sets/file.go

func (*RepoInfo) Name

func (o *RepoInfo) Name() string

Name is just going to return the name mungers use to request this feature

Jump to

Keyboard shortcuts

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