Documentation
¶
Index ¶
- Variables
- type CodeOwners
- type Config
- type Entry
- type Evaluation
- type EvaluationEntry
- type File
- type FileParseError
- type OwnerEvaluation
- type Service
- func (s *Service) Evaluate(ctx context.Context, repo *types.Repository, pr *types.PullReq, ...) (*Evaluation, error)
- func (s *Service) Validate(ctx context.Context, repo *types.Repository, branch string) (*types.CodeOwnersValidation, error)
- func (s *Service) ValidateCodeOwnerByPush(ctx context.Context, repo *types.Repository, uid int64, ...) ([]Entry, error)
- type TooLargeError
- type UserGroupOwnerEvaluation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("file not found") ErrFileParseInvalidEscapingInPattern = errors.New( "a pattern requires '\\' to be escaped with another '\\', or used to escape control characters " + "[space, tab, '#'] or any of the available special characters " + "['*', '?', '[', ']', '{', '}', '-', '!', '^']", ) ErrFileParseTrailingBackslashInPattern = errors.New("a pattern can't end with a trailing '\\'") )
View Source
var WireSet = wire.NewSet( ProvideCodeOwners, )
Functions ¶
This section is empty.
Types ¶
type CodeOwners ¶
type Entry ¶
type Entry struct {
// LineNumber is the line number of the code owners entry.
LineNumber int64
// Pattern is a glob star pattern used to match the entry against a given file path.
Pattern string
// Owners is the list of owners for the given pattern.
// NOTE: Could be empty in case of an entry that clears previously defined ownerships.
Owners []string
}
func (*Entry) IsOwnershipReset ¶
IsOwnershipReset returns true iff the entry resets any previously defined ownerships.
type Evaluation ¶
type Evaluation struct {
EvaluationEntries []EvaluationEntry
FileSha string
}
type EvaluationEntry ¶
type EvaluationEntry struct {
LineNumber int64
Pattern string
OwnerEvaluations []OwnerEvaluation
UserGroupOwnerEvaluations []UserGroupOwnerEvaluation
}
type FileParseError ¶
FileParseError represents an error if codeowners file is not parsable.
func (*FileParseError) Error ¶
func (e *FileParseError) Error() string
func (*FileParseError) Is ¶
func (e *FileParseError) Is(target error) bool
func (*FileParseError) Unwrap ¶
func (e *FileParseError) Unwrap() error
type OwnerEvaluation ¶
type OwnerEvaluation struct {
Owner types.PrincipalInfo
ReviewDecision enum.PullReqReviewDecision
ReviewSHA string
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func ProvideCodeOwners ¶
func (*Service) Evaluate ¶
func (s *Service) Evaluate( ctx context.Context, repo *types.Repository, pr *types.PullReq, reviewers []*types.PullReqReviewer, ) (*Evaluation, error)
func (*Service) Validate ¶
func (s *Service) Validate( ctx context.Context, repo *types.Repository, branch string, ) (*types.CodeOwnersValidation, error)
func (*Service) ValidateCodeOwnerByPush ¶
type TooLargeError ¶
type TooLargeError struct {
FileSize int64
}
TooLargeError represents an error if codeowners file is too large.
func (*TooLargeError) Error ¶
func (e *TooLargeError) Error() string
func (*TooLargeError) Is ¶
func (e *TooLargeError) Is(target error) bool
type UserGroupOwnerEvaluation ¶
type UserGroupOwnerEvaluation struct {
Identifier string
Name string
Evaluations []OwnerEvaluation
}
Click to show internal directories.
Click to hide internal directories.