Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeFile = "file" ContentTypeDir = "dir" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationType ¶
type AuthorizationType string
AuthorizationType represents the usergroup that is allowed to do the action
const ( AuthorizationAll AuthorizationType = "all" AuthorizationOrg AuthorizationType = "org" AuthorizationTeam AuthorizationType = "team" AuthorizationCodeOwners AuthorizationType = "codeowners" AuthorizationOrgAdmin AuthorizationType = "org-admin" )
type Client ¶
type Client interface { Client() *github.Client GetHead(ctx context.Context, event *GenericRequestEvent) (string, error) GetIssue(event *GenericRequestEvent) (*github.Issue, error) GetPullRequest(ctx context.Context, event *GenericRequestEvent) (*github.PullRequest, error) GetVersions(owner, repo string) ([]*semver.Version, error) GetContent(ctx context.Context, event *GenericRequestEvent, path string) ([]byte, error) IsAuthorized(authorizationType AuthorizationType, event *GenericRequestEvent) bool GetConfig(name string, obj interface{}) error GetRawConfig(name string) (json.RawMessage, error) ResolveConfigValue(ctx context.Context, event *GenericRequestEvent, value *ghval.GitHubValue) (string, error) UpdateComment(event *GenericRequestEvent, commentID int64, message string) error Comment(ctx context.Context, event *GenericRequestEvent, message string) (int64, error) UpdateStatus(ctx context.Context, event *GenericRequestEvent, state State, statusContext, description string) error }
Client is the github client interface
type EventActionType ¶
type EventActionType string
EventActionType represents the action type of a github event
const ( EventActionTypeCreated EventActionType = "created" EventActionTypeDeleted EventActionType = "deleted" EventActionTypeEdited EventActionType = "edited" )
type GenericRequestEvent ¶
type GenericRequestEvent struct { // InstallationID is the github app ID InstallationID int64 // ID is the unique github id of the comment ID int64 // Number is the number of the PR Number int // Head is the sha of the current PR's head commit Head string // Repository is the event's source repository Repository *github.Repository // Body comprises the message body of the commit Body string // Author is the event's author Author *github.User }
GenericRequestEvent is the generic request from github triggering the tm bot
func (*GenericRequestEvent) GetAuthorName ¶
func (e *GenericRequestEvent) GetAuthorName() string
func (*GenericRequestEvent) GetMessage ¶
func (e *GenericRequestEvent) GetMessage() string
func (*GenericRequestEvent) GetOwnerName ¶
func (e *GenericRequestEvent) GetOwnerName() string
func (*GenericRequestEvent) GetRepositoryKey ¶
func (e *GenericRequestEvent) GetRepositoryKey() RepositoryKey
func (*GenericRequestEvent) GetRepositoryName ¶
func (e *GenericRequestEvent) GetRepositoryName() string
type Manager ¶
type Manager interface {
GetClient(event *GenericRequestEvent) (Client, error)
}
type MembershipRole ¶
type MembershipRole string
MembershipRole represents the membership role of organizations and teams
const ( MembershipRoleAdmin MembershipRole = "admin" MembershipRoleMember MembershipRole = "member" MembershipRoleMaintainer MembershipRole = "maintainer" )
type MembershipStatus ¶
type MembershipStatus string
MembershipStatus represents the current membership status of a user
const (
MembershipStatusActive MembershipStatus = "active"
)
type RepositoryKey ¶
RepositoryKey is the unique name for a repository
Source Files ¶
Click to show internal directories.
Click to hide internal directories.