Documentation ¶
Index ¶
- func AuthRoundTripperFromAppCredentials(ctx context.Context, base http.RoundTripper, appId, installationId int64, ...) (http.RoundTripper, error)
- func AuthRoundTripperFromToken(ctx context.Context, base http.RoundTripper, token string) (http.RoundTripper, error)
- func RateLimitRoundTripper(ctx context.Context, base http.RoundTripper, opts ...github_ratelimit.Option) (http.RoundTripper, error)
- type App
- type BranchActorAllowanceActor
- type BranchActorAllowanceActors
- type BranchProtection
- func (bp *BranchProtection) GetBypassForcePushAllowances() *BranchActorAllowanceActors
- func (bp *BranchProtection) GetBypassPullRequestAllowances() *BranchActorAllowanceActors
- func (bp *BranchProtection) GetPushAllowances() *PushAllowanceActors
- func (bp *BranchProtection) GetReviewDismissalAllowances() *ReviewDismissalAllowanceActors
- type BypassForcePushAllowances
- type BypassPullRequestAllowances
- type Client
- func (c *Client) CreateBranchProtection(ctx context.Context, input *githubv4.CreateBranchProtectionRuleInput) (*BranchProtection, error)
- func (c *Client) CreateRepository(ctx context.Context, org string, create *github.Repository) (*github.Repository, error)
- func (c *Client) CreateRepositoryFromTemplate(ctx context.Context, templateOwner string, templateRepository string, ...) (*github.Repository, error)
- func (c *Client) CreateTeam(ctx context.Context, org string, newTeam github.NewTeam) (*github.Team, error)
- func (c *Client) DeleteBranchProtection(ctx context.Context, input *githubv4.DeleteBranchProtectionRuleInput) error
- func (c *Client) DeleteOrganization(ctx context.Context, login string) error
- func (c *Client) DeleteRepositoryByName(ctx context.Context, owner, name string) error
- func (c *Client) DeleteTeamById(ctx context.Context, org, slug int64) error
- func (c *Client) DeleteTeamBySlug(ctx context.Context, org, slug string) error
- func (c *Client) GetBranchProtection(ctx context.Context, nodeId string) (*BranchProtection, error)
- func (c *Client) GetBranchProtectionByOwnerRepoPattern(ctx context.Context, repositoryOwner, repositoryName, pattern string) (*BranchProtection, error)
- func (c *Client) GetOrganization(ctx context.Context, login string) (*github.Organization, error)
- func (c *Client) GetOrganizationByDatabaseId(ctx context.Context, dbId int64) (*github.Organization, error)
- func (c *Client) GetOrganizationByNodeId(ctx context.Context, nodeId string) (*github.Organization, error)
- func (c *Client) GetRepositoryByDatabaseId(ctx context.Context, dbId int64) (*github.Repository, error)
- func (c *Client) GetRepositoryByName(ctx context.Context, owner string, name string) (*github.Repository, error)
- func (c *Client) GetRepositoryByNodeId(ctx context.Context, nodeId string) (*github.Repository, error)
- func (c *Client) GetTeamById(ctx context.Context, orgId, teamId int64) (*github.Team, error)
- func (c *Client) GetTeamByNodeId(ctx context.Context, nodeId string) (*github.Team, error)
- func (c *Client) GetTeamBySlug(ctx context.Context, org, slug string) (*github.Team, error)
- func (c *Client) GetTeamRepositoryPermission(ctx context.Context, org, slug, repoName string) (*TeamRepositoryPermission, error)
- func (c *Client) GetTeamRepositoryPermissions(ctx context.Context, org, slug string) ([]*TeamRepositoryPermission, error)
- func (c *Client) RemoveTeamRepositoryPermissions(ctx context.Context, org, slug string, repoName string) error
- func (c *Client) UpdateBranchProtection(ctx context.Context, input *githubv4.UpdateBranchProtectionRuleInput) (*BranchProtection, error)
- func (c *Client) UpdateOrganization(ctx context.Context, login string, updateOrg *github.Organization) (*github.Organization, error)
- func (c *Client) UpdateRepositoryByName(ctx context.Context, owner, name string, update *github.Repository) (*github.Repository, error)
- func (c *Client) UpdateRepositoryTopics(ctx context.Context, owner string, repo string, topics []string) ([]string, error)
- func (c *Client) UpdateTeamById(ctx context.Context, org, teamId int64, newTeam github.NewTeam) (*github.Team, error)
- func (c *Client) UpdateTeamBySlug(ctx context.Context, org, slug string, newTeam github.NewTeam) (*github.Team, error)
- func (c *Client) UpdateTeamRepositoryPermissions(ctx context.Context, org, slug string, repoName, permission string) error
- type ClientOption
- type Conflict
- type OrganizationNotFoundError
- type PageInfo
- type PushAllowanceActor
- type PushAllowanceActors
- type PushAllowances
- type RepositoryNotFoundError
- type RequiredStatusCheckDescription
- type ReviewDismissalAllowanceActor
- type ReviewDismissalAllowanceActors
- type ReviewDismissalAllowances
- type Team
- type TeamNotFoundError
- type TeamRepositoryPermission
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthRoundTripperFromAppCredentials ¶
func AuthRoundTripperFromAppCredentials(ctx context.Context, base http.RoundTripper, appId, installationId int64, pKey []byte) (http.RoundTripper, error)
func AuthRoundTripperFromToken ¶
func AuthRoundTripperFromToken(ctx context.Context, base http.RoundTripper, token string) (http.RoundTripper, error)
func RateLimitRoundTripper ¶
func RateLimitRoundTripper(ctx context.Context, base http.RoundTripper, opts ...github_ratelimit.Option) (http.RoundTripper, error)
Types ¶
type BranchActorAllowanceActor ¶
type BranchActorAllowanceActor struct { App App `graphql:"... on App"` Team Team `graphql:"... on Team"` User User `graphql:"... on User"` }
Used for: - BypassPullRequestAllowance - BypassForcePushAllowance
type BranchActorAllowanceActors ¶
TODO: these are distinct in GitHub, but can probably reduce redundancy
type BranchProtection ¶
type BranchProtection struct { AllowsDeletions bool AllowsForcePushes bool BlocksCreations bool BypassForcePushAllowances BypassForcePushAllowances `graphql:"bypassForcePushAllowances(first: 100)"` BypassPullRequestAllowances BypassPullRequestAllowances `graphql:"bypassPullRequestAllowances(first: 100)"` DismissesStaleReviews bool Id string IsAdminEnforced bool LockAllowsFetchAndMerge bool LockBranch bool // TODO: future feature // MatchingRefs Pattern string PushAllowances PushAllowances `graphql:"pushAllowances(first: 100)"` Repository struct { Id string DatabaseId int64 Name string Owner struct { Login string Id string } } RequireLastPushApproval bool RequiredApprovingReviewCount int64 RequiredDeploymentEnvironments []string RequiredStatusCheckContexts []string RequiredStatusChecks []RequiredStatusCheckDescription RequiresApprovingReviews bool RequiresCodeOwnerReviews bool RequiresCommitSignatures bool RequiresConversationResolution bool RequiresDeployments bool RequiresLinearHistory bool RequiresStatusChecks bool RequiresStrictStatusChecks bool RestrictsPushes bool RestrictsReviewDismissals bool ReviewDismissalAllowances ReviewDismissalAllowances `graphql:"reviewDismissalAllowances(first: 100)"` }
func (*BranchProtection) GetBypassForcePushAllowances ¶
func (bp *BranchProtection) GetBypassForcePushAllowances() *BranchActorAllowanceActors
func (*BranchProtection) GetBypassPullRequestAllowances ¶
func (bp *BranchProtection) GetBypassPullRequestAllowances() *BranchActorAllowanceActors
func (*BranchProtection) GetPushAllowances ¶
func (bp *BranchProtection) GetPushAllowances() *PushAllowanceActors
func (*BranchProtection) GetReviewDismissalAllowances ¶
func (bp *BranchProtection) GetReviewDismissalAllowances() *ReviewDismissalAllowanceActors
type BypassForcePushAllowances ¶
type BypassForcePushAllowances struct { Nodes []struct { Actor BranchActorAllowanceActor } PageInfo PageInfo }
type BypassPullRequestAllowances ¶
type BypassPullRequestAllowances struct { Nodes []struct { Actor BranchActorAllowanceActor } PageInfo PageInfo }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) (*Client, error)
func (*Client) CreateBranchProtection ¶
func (c *Client) CreateBranchProtection(ctx context.Context, input *githubv4.CreateBranchProtectionRuleInput) (*BranchProtection, error)
func (*Client) CreateRepository ¶
func (c *Client) CreateRepository(ctx context.Context, org string, create *github.Repository) (*github.Repository, error)
Pass empty string as org to create a user-owned repo
func (*Client) CreateRepositoryFromTemplate ¶
func (c *Client) CreateRepositoryFromTemplate(ctx context.Context, templateOwner string, templateRepository string, req *github.TemplateRepoRequest) (*github.Repository, error)
Pass empty string as org to create a user-owned repo
func (*Client) CreateTeam ¶
func (*Client) DeleteBranchProtection ¶
func (*Client) DeleteOrganization ¶
func (*Client) DeleteRepositoryByName ¶
func (*Client) DeleteTeamById ¶
func (*Client) DeleteTeamBySlug ¶
func (*Client) GetBranchProtection ¶
func (*Client) GetBranchProtectionByOwnerRepoPattern ¶
func (c *Client) GetBranchProtectionByOwnerRepoPattern(ctx context.Context, repositoryOwner, repositoryName, pattern string) (*BranchProtection, error)
this is inefficient and should ideally not be used
func (*Client) GetOrganization ¶
func (*Client) GetOrganizationByDatabaseId ¶
func (*Client) GetOrganizationByNodeId ¶
func (*Client) GetRepositoryByDatabaseId ¶
func (*Client) GetRepositoryByName ¶
func (c *Client) GetRepositoryByName(ctx context.Context, owner string, name string) (*github.Repository, error)
Repositories
func (*Client) GetRepositoryByNodeId ¶
func (*Client) GetTeamById ¶
func (*Client) GetTeamByNodeId ¶
func (*Client) GetTeamBySlug ¶
Teams
func (*Client) GetTeamRepositoryPermission ¶
func (c *Client) GetTeamRepositoryPermission(ctx context.Context, org, slug, repoName string) (*TeamRepositoryPermission, error)
assume repo is in the same org as team
func (*Client) GetTeamRepositoryPermissions ¶
func (c *Client) GetTeamRepositoryPermissions(ctx context.Context, org, slug string) ([]*TeamRepositoryPermission, error)
assume repo is in the same org as team
func (*Client) RemoveTeamRepositoryPermissions ¶
func (*Client) UpdateBranchProtection ¶
func (c *Client) UpdateBranchProtection(ctx context.Context, input *githubv4.UpdateBranchProtectionRuleInput) (*BranchProtection, error)
func (*Client) UpdateOrganization ¶
func (c *Client) UpdateOrganization(ctx context.Context, login string, updateOrg *github.Organization) (*github.Organization, error)
func (*Client) UpdateRepositoryByName ¶
func (c *Client) UpdateRepositoryByName(ctx context.Context, owner, name string, update *github.Repository) (*github.Repository, error)
func (*Client) UpdateRepositoryTopics ¶
func (*Client) UpdateTeamById ¶
func (*Client) UpdateTeamBySlug ¶
type ClientOption ¶
func WithHttpClient ¶
func WithHttpClient(client *http.Client) ClientOption
func WithRoundTripper ¶
func WithRoundTripper(rt http.RoundTripper) ClientOption
type OrganizationNotFoundError ¶
func (*OrganizationNotFoundError) Error ¶
func (e *OrganizationNotFoundError) Error() string
type PushAllowanceActor ¶
type PushAllowanceActor struct { App App `graphql:"... on App"` Team Team `graphql:"... on Team"` User User `graphql:"... on User"` }
Used for: - PushAllowances
type PushAllowanceActors ¶
type PushAllowances ¶
type PushAllowances struct { Nodes []struct { Actor PushAllowanceActor } PageInfo PageInfo }
type RepositoryNotFoundError ¶
func (*RepositoryNotFoundError) Error ¶
func (e *RepositoryNotFoundError) Error() string
type ReviewDismissalAllowanceActor ¶
type ReviewDismissalAllowanceActor struct { App App `graphql:"... on App"` Team Team `graphql:"... on Team"` User User `graphql:"... on User"` }
Used for: - ReviewDismissalAllowances
type ReviewDismissalAllowances ¶
type ReviewDismissalAllowances struct { Nodes []struct { Actor ReviewDismissalAllowanceActor } PageInfo PageInfo }
type TeamNotFoundError ¶
func (*TeamNotFoundError) Error ¶
func (e *TeamNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.