Documentation ¶
Index ¶
- Constants
- type Owners
- func (o *Owners) Approvers(path string) UsernameSet
- func (o *Owners) IsApprover(user, path string) bool
- func (o *Owners) IsRequiredReviewer(user, path string) bool
- func (o *Owners) IsReviewer(user, path string) bool
- func (o *Owners) RequiredReviewers(path string) UsernameSet
- func (o *Owners) Reviewers(path string) UsernameSet
- type UsernameSet
- func (us UsernameSet) Add(usernames ...string)
- func (us UsernameSet) Copy() UsernameSet
- func (us UsernameSet) Delete(usernames ...string)
- func (us UsernameSet) Has(username string) bool
- func (us UsernameSet) List() []string
- func (us UsernameSet) Pop() (string, bool)
- func (us UsernameSet) String() string
- func (us UsernameSet) Union(us2 UsernameSet) UsernameSet
Constants ¶
const ( DefaultOwnersFilename = "OWNERS" DefaultAliasesFilename = "OWNERS_ALIASES" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Owners ¶
type Owners struct {
// contains filtered or unexported fields
}
Owners holds Owners configuration for one repository.
func LoadRemote ¶
func (*Owners) Approvers ¶
func (o *Owners) Approvers(path string) UsernameSet
Approvers returns a set of approvers for given file path.
func (*Owners) IsApprover ¶
IsApprover returns true if given user is an approver for given file path.
func (*Owners) IsRequiredReviewer ¶
IsRequiredReviewer returns true if given user is a required reviewer for given path.
func (*Owners) IsReviewer ¶
IsReviewer returns true if given user is a reviewer for given file path.
func (*Owners) RequiredReviewers ¶
func (o *Owners) RequiredReviewers(path string) UsernameSet
RequiredReviewers returns a set of required reviewers for given file path.
func (*Owners) Reviewers ¶
func (o *Owners) Reviewers(path string) UsernameSet
Reviewers returns a set of reviewers for given file path.
type UsernameSet ¶
type UsernameSet map[string]struct{}
UsernameSet is a set type for usernames.
func (UsernameSet) Add ¶
func (us UsernameSet) Add(usernames ...string)
Add given usernames to the set. This function is mutable.
func (UsernameSet) Copy ¶
func (us UsernameSet) Copy() UsernameSet
Copy returns a new copy of UsernameSet.
func (UsernameSet) Delete ¶
func (us UsernameSet) Delete(usernames ...string)
Delete given usernames from the set. This function is mutable.
func (UsernameSet) Has ¶
func (us UsernameSet) Has(username string) bool
Has returns true if given username is a member of the set.
func (UsernameSet) List ¶
func (us UsernameSet) List() []string
List returns a sorted list which contains members of set.
func (UsernameSet) Pop ¶
func (us UsernameSet) Pop() (string, bool)
Pop returns a username from the set and remove it. Return true if the returned value at first return, is a member of the set, otherwise false as second return value..
func (UsernameSet) String ¶
func (us UsernameSet) String() string
func (UsernameSet) Union ¶
func (us UsernameSet) Union(us2 UsernameSet) UsernameSet
Union get a new set which contains the members of the set and the members of given set. This function is immutable.