ghapp

package
v0.0.0-...-ebf29b9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type AcceptPullRequestOutput

type AcceptPullRequestOutput struct {
	AddPullRequestReview struct {
		PullRequestReview struct {
			ID githubv4.ID
		}
	} `graphql:"addPullRequestReview(input: $input)"`
}

type CreatePullRequest

type CreatePullRequest struct {
	CreatePullRequest struct {
		// Note: This is unused, but the library requires at least something to be read for the mutation to happen
		ClientMutationID githubv4.ID
	} `graphql:"createPullRequest(input: $input)"`
}

type DynamicAuthMethod

type DynamicAuthMethod struct {
	Itr    *ghinstallation.Transport
	Logger *zapctx.Logger
}

func (*DynamicAuthMethod) Name

func (d *DynamicAuthMethod) Name() string

func (*DynamicAuthMethod) SetAuth

func (d *DynamicAuthMethod) SetAuth(r *http2.Request)

func (*DynamicAuthMethod) String

func (d *DynamicAuthMethod) String() string

type GithubAPI

type GithubAPI interface {
	RepositoryInfo(ctx context.Context, owner string, name string) (*RepositoryInfo, error)
	CreatePullRequest(ctx context.Context, owner string, name string, in githubv4.CreatePullRequestInput) (*CreatePullRequest, error)
	GoGetAuthMethod() http.AuthMethod
	GetContents(ctx context.Context, owner string, name string, file string) (string, error)
	Self(ctx context.Context) (*UserInfo, error)
	AcceptPullRequest(ctx context.Context, owner string, name string, in githubv4.AddPullRequestReviewInput) (*AcceptPullRequestOutput, error)
	MergePullRequest(ctx context.Context, owner string, name string, ref string, in githubv4.MergePullRequestInput) (*MergePullRequestOutput, error)
	EveryOpenPullRequest(ctx context.Context, owner string, name string) (*GraphQLPRQuery, error)
	DoesBranchExist(ctx context.Context, owner string, name string, ref string) (bool, error)
}

type GraphQLPRQuery

type GraphQLPRQuery struct {
	Repository struct {
		PullRequests struct {
			Nodes []GraphQLPRQueryNode
		} `graphql:"pullRequests(first: 100, states: [OPEN])"`
	} `graphql:"repository(owner: $owner, name: $name)"`
}

type GraphQLPRQueryNode

type GraphQLPRQueryNode struct {
	ID                githubv4.ID
	Number            githubv4.Int
	Locked            githubv4.Boolean
	Merged            githubv4.Boolean
	IsDraft           githubv4.Boolean
	Mergeable         githubv4.MergeableState
	State             githubv4.PullRequestState
	Body              githubv4.String
	UpdatedAt         githubv4.DateTime
	ReviewDecision    githubv4.PullRequestReviewDecision
	IsCrossRepository githubv4.Boolean
	BaseRef           struct {
		Name githubv4.String
	}
	Repository struct {
		Owner struct {
			Login githubv4.String
		}
		Name githubv4.String
	}
	Author struct {
		Login githubv4.String
		Bot   struct {
			ID githubv4.ID
		} `graphql:"... on Bot"`
		User struct {
			ID githubv4.ID
		} `graphql:"... on User"`
	}
	ViewerLatestReview struct {
		State  githubv4.String
		Commit struct {
			Oid githubv4.GitObjectID
		}
		AuthorCanPushToRepository githubv4.Boolean
	}
	HeadRef struct {
		Target struct {
			Oid    githubv4.GitObjectID
			Commit struct {
				StatusCheckRollup struct {
					State githubv4.StatusState
				}
			} `graphql:"... on Commit"`
		}
	}
}

GraphQLPRQueryNode is our catch-all pull request data

type MergePullRequestOutput

type MergePullRequestOutput struct {
	MergePullRequest struct {
		PullRequest struct {
			ID githubv4.ID
		}
	} `graphql:"mergePullRequest(input: $input)"`
}

type RepositoryInfo

type RepositoryInfo struct {
	Repository struct {
		ID               githubv4.ID
		DefaultBranchRef struct {
			Name githubv4.String
			ID   githubv4.ID
		}
	} `graphql:"repository(owner: $owner, name: $name)"`
}

type UserInfo

type UserInfo struct {
	Login githubv4.String
	ID    githubv4.ID
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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