cache

package
v0.0.0-...-4bf5158 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(endpoint string, log *logrus.Entry) *Cache

func (*Cache) LoadRepoOwners

func (c *Cache) LoadRepoOwners(b RepoBranch) (RepoOwner, error)

func (*Cache) SyncPerDay

func (c *Cache) SyncPerDay(start time.Duration) func()

type RepoBranch

type RepoBranch = models.Branch

type RepoOwner

type RepoOwner interface {
	FindApproverOwnersForFile(path string) string
	FindReviewersOwnersForFile(path string) string
	LeafApprovers(path string) sets.String
	Approvers(path string) sets.String
	LeafReviewers(path string) sets.String
	Reviewers(path string) sets.String
	IsNoParentOwners(path string) bool
	AllReviewers() sets.String
	TopLevelApprovers() sets.String
}

RepoOwner is an interface to work with repoowners

type RepoOwnerInfo

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

func (*RepoOwnerInfo) AllReviewers

func (o *RepoOwnerInfo) AllReviewers() sets.String

AllReviewers gets all reviewers including approvers.

func (*RepoOwnerInfo) Approvers

func (o *RepoOwnerInfo) Approvers(path string) sets.String

Approvers returns ALL of the users who are approvers for the requested file (including approvers in parent dirs' OWNERS). 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 (*RepoOwnerInfo) FindApproverOwnersForFile

func (o *RepoOwnerInfo) FindApproverOwnersForFile(path string) string

FindApproverOwnersForFile returns the OWNERS file path furthest down the tree for a specified file that contains an approvers section

func (*RepoOwnerInfo) FindReviewersOwnersForFile

func (o *RepoOwnerInfo) FindReviewersOwnersForFile(path string) string

FindReviewersOwnersForFile returns the OWNERS file path furthest down the tree for a specified file that contains a reviewers section

func (*RepoOwnerInfo) IsNoParentOwners

func (o *RepoOwnerInfo) IsNoParentOwners(path string) bool

IsNoParentOwners checks if an OWNERS file path refers to an OWNERS file with NoParentOwners enabled.

func (*RepoOwnerInfo) LeafApprovers

func (o *RepoOwnerInfo) LeafApprovers(path string) sets.String

LeafApprovers returns a set of users who are the closest approvers 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 (*RepoOwnerInfo) LeafReviewers

func (o *RepoOwnerInfo) LeafReviewers(path string) sets.String

LeafReviewers returns a set of users who are the closest reviewers 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 (*RepoOwnerInfo) Reviewers

func (o *RepoOwnerInfo) Reviewers(path string) sets.String

Reviewers returns ALL of the users who are reviewers for the requested file (including reviewers in parent dirs' OWNERS). 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 (*RepoOwnerInfo) TopLevelApprovers

func (o *RepoOwnerInfo) TopLevelApprovers() sets.String

TopLevelApprovers gets the approvers at directory of '.'.

Jump to

Keyboard shortcuts

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