Documentation
¶
Index ¶
- type AdminEnforcement
- type App
- type Branch
- type BranchRestrictions
- type CommitAuthor
- type DismissalRestrictions
- type Hook
- type HookConfig
- type InstallationPermissions
- type License
- type Organization
- type Package
- type PackageRegistry
- type Plan
- type Protection
- type PullRequestReviewsEnforcement
- type Repository
- type RepositoryCommit
- type RequiredStatusChecks
- type SignatureVerification
- type Team
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminEnforcement ¶
AdminEnforcement represents the configuration to enforce required status checks for repository administrators.
type App ¶
type App struct {
ID *int64
Slug *string
NodeID *string
Owner *User
Name *string
Description *string
ExternalURL *string
HTMLURL *string
CreatedAt *utils.Timestamp
UpdatedAt *utils.Timestamp
Permissions *InstallationPermissions
Events []string
}
App represents a GitHub App.
type Branch ¶
type Branch struct {
Name *string `json:"name,omitempty"`
Commit *RepositoryCommit
Protected *bool `json:"protected,omitempty"`
}
Branch represents a repository branch
type BranchRestrictions ¶
type BranchRestrictions struct {
// The list of user logins with push access.
Users []*User
// The list of team slugs with push access.
Teams []*Team
// The list of app slugs with push access.
Apps []*App
}
BranchRestrictions represents the restriction that only certain users or teams may push to a branch.
type CommitAuthor ¶
type DismissalRestrictions ¶
type DismissalRestrictions struct {
// The list of users who can dimiss pull request reviews.
Users []*User `json:"users"`
}
DismissalRestrictions specifies which users and teams can dismiss pull request reviews.
type Hook ¶
type Hook struct {
CreatedAt *time.Time
UpdatedAt *time.Time
URL *string
ID *int64
Type *string
Name *string
TestURL *string
PingURL *string
LastResponse map[string]interface{}
// Only the following fields are used when creating a hook.
// Config is required.
Config *HookConfig
Events []string
Active *bool
}
type HookConfig ¶
type InstallationPermissions ¶
type InstallationPermissions struct {
Actions *string
Administration *string
Blocking *string
Checks *string
Contents *string
ContentReferences *string
Deployments *string
Emails *string
Environments *string
Followers *string
Issues *string
Metadata *string
Members *string
OrganizationAdministration *string
OrganizationHooks *string
OrganizationPlan *string
OrganizationPreReceiveHooks *string
OrganizationProjects *string
OrganizationSecrets *string
OrganizationSelfHostedRunners *string
OrganizationUserBlocking *string
Packages *string
Pages *string
PullRequests *string
RepositoryHooks *string
RepositoryProjects *string
RepositoryPreReceiveHooks *string
Secrets *string
SecretScanningAlerts *string
SecurityEvents *string
SingleFile *string
Statuses *string
TeamDiscussions *string
VulnerabilityAlerts *string
Workflows *string
}
InstallationPermissions lists the repository and organization permissions for an installation.
type License ¶
type License struct {
Key *string `json:"key,omitempty"`
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
SPDXID *string `json:"spdx_id,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
Featured *bool `json:"featured,omitempty"`
Description *string `json:"description,omitempty"`
Implementation *string `json:"implementation,omitempty"`
Conditions *[]string `json:"conditions,omitempty"`
Permissions *[]string `json:"permissions,omitempty"`
Limitations *[]string `json:"limitations,omitempty"`
Body *string `json:"body,omitempty"`
}
type Organization ¶
type Organization struct {
Login *string
ID *int64
NodeID *string
Name *string
Company *string
Location *string
Email *string
Description *string
PublicRepos *int
CreatedAt *time.Time
UpdatedAt *time.Time
TotalPrivateRepos *int
OwnedPrivateRepos *int
Collaborators *int
Type *string
Plan *Plan
DefaultRepoPermission *string
DefaultRepoSettings *string
MembersCanCreateRepos *bool
MembersCanCreatePublicRepos *bool
MembersCanCreatePrivateRepos *bool
MembersCanCreateInternalRepos *bool
TwoFactorRequirementEnabled *bool
IsVerified *bool
Members []*User
IsRepositoryDeletionLimited *bool
IsIssueDeletionLimited *bool
Hooks []*Hook
}
type PackageRegistry ¶
type Protection ¶
type Protection struct {
RequiredStatusChecks *RequiredStatusChecks
RequiredPullRequestReviews *PullRequestReviewsEnforcement
EnforceAdmins *AdminEnforcement
Restrictions *BranchRestrictions
RequireLinearHistory bool
AllowForcePushes bool
AllowDeletions bool
RequiredConversationResolution bool
RequiredSignedCommit bool
}
type PullRequestReviewsEnforcement ¶
type PullRequestReviewsEnforcement struct {
// Specifies which users and teams can dismiss pull request reviews.
DismissalRestrictions *DismissalRestrictions
// Specifies if approved reviews are dismissed automatically, when a new commit is pushed.
DismissStaleReviews bool
// RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner.
RequireCodeOwnerReviews bool
// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
// Valid values are 1-6.
RequiredApprovingReviewCount int
}
PullRequestReviewsEnforcement represents the pull request reviews enforcement of a protected branch.
type Repository ¶
type Repository struct {
ID *int64
NodeID *string `json:"node_id,omitempty"`
Owner *User `json:"owner,omitempty"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
DefaultBranch *string `json:"default_branch,omitempty"`
MasterBranch *string `json:"master_branch,omitempty"`
CreatedAt *utils.Timestamp `json:"created_at,omitempty"`
PushedAt *utils.Timestamp `json:"pushed_at,omitempty"`
UpdatedAt *utils.Timestamp `json:"updated_at,omitempty"`
Language *string `json:"language,omitempty"`
Fork *bool `json:"fork,omitempty"`
ForksCount *int `json:"forks_count,omitempty"`
NetworkCount *int `json:"network_count,omitempty"`
OpenIssuesCount *int `json:"open_issues_count,omitempty"`
StargazersCount *int `json:"stargazers_count,omitempty"`
SubscribersCount *int `json:"subscribers_count,omitempty"`
WatchersCount *int `json:"watchers_count,omitempty"`
Size *int `json:"size,omitempty"`
AutoInit *bool `json:"auto_init,omitempty"`
Parent *Repository `json:"parent,omitempty"`
Source *Repository `json:"source,omitempty"`
Organization *Organization `json:"organization,omitempty"`
AllowRebaseMerge *bool
AllowSquashMerge *bool
AllowMergeCommit *bool
Topics []string `json:"topics,omitempty"`
// Only provided when using RepositoriesService.Get while in preview
License *License `json:"license,omitempty"`
// Additional mutable fields when creating and editing a repository
IsPrivate *bool
HasIssues *bool `json:"has_issues,omitempty"`
LicenseTemplate *string `json:"license_template,omitempty"`
GitignoreTemplate *string `json:"gitignore_template,omitempty"`
Archived *bool `json:"archived,omitempty"`
// Creating an organization repository. Required for non-owners.
TeamID *int64 `json:"team_id,omitempty"`
// API URLs
URL *string `json:"url,omitempty"`
Branches []*Branch
Collaborators []*User
IsContainsSecurityMd bool
Commits []*RepositoryCommit
Hooks []*Hook
}
type RepositoryCommit ¶
type RepositoryCommit struct {
NodeID *string `json:"node_id,omitempty"`
SHA *string `json:"sha,omitempty"`
Author *CommitAuthor
Committer *CommitAuthor
URL *string `json:"url,omitempty"`
Verification *SignatureVerification `json:"verification,omitempty"`
}
type RequiredStatusChecks ¶
type RequiredStatusChecks struct {
Strict bool
}
type SignatureVerification ¶
type SignatureVerification struct {
Verified *bool `json:"verified,omitempty"`
Reason *string `json:"reason,omitempty"`
Signature *string `json:"signature,omitempty"`
Payload *string `json:"payload,omitempty"`
}
SignatureVerification represents GPG signature verification.
type Team ¶
type Team struct {
ID *int64
Name *string
Description *string
URL *string
Slug *string
// Permission specifies the default permission for repositories owned by the team.
Permission *string
// Permissions identifies the permissions that a team has on a given
// repository. This is only populated when calling Repositories.ListTeams.
Permissions map[string]bool
// Privacy identifies the level of privacy this team should have.
// Possible values are:
// secret - only visible to organization owners and members of this team
// closed - visible to all members of this organization
// Default is "secret".
Privacy *string
MembersCount *int
ReposCount *int
}
Team represents a team within a GitHub organization. Teams are used to manage access to an organization's repositories.
type User ¶
type User struct {
Login *string `json:"login,omitempty"`
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
AvatarURL *string `json:"avatar_url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
GravatarID *string `json:"gravatar_id,omitempty"`
Name *string `json:"name,omitempty"`
Company *string `json:"company,omitempty"`
Blog *string `json:"blog,omitempty"`
Location *string `json:"location,omitempty"`
Email *string `json:"email,omitempty"`
Hireable *bool `json:"hireable,omitempty"`
Bio *string `json:"bio,omitempty"`
PublicRepos *int `json:"public_repos,omitempty"`
PublicGists *int `json:"public_gists,omitempty"`
Followers *int `json:"followers,omitempty"`
Following *int `json:"following,omitempty"`
CreatedAt *utils.Timestamp `json:"created_at,omitempty"`
UpdatedAt *utils.Timestamp `json:"updated_at,omitempty"`
SuspendedAt *utils.Timestamp `json:"suspended_at,omitempty"`
Type *string `json:"type,omitempty"`
SiteAdmin *bool `json:"site_admin,omitempty"`
TotalPrivateRepos *int `json:"total_private_repos,omitempty"`
OwnedPrivateRepos *int `json:"owned_private_repos,omitempty"`
PrivateGists *int `json:"private_gists,omitempty"`
DiskUsage *int `json:"disk_usage,omitempty"`
Collaborators *int `json:"collaborators,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Role string
// API URLs
URL *string `json:"url,omitempty"`
EventsURL *string `json:"events_url,omitempty"`
FollowingURL *string `json:"following_url,omitempty"`
FollowersURL *string `json:"followers_url,omitempty"`
GistsURL *string `json:"gists_url,omitempty"`
OrganizationsURL *string `json:"organizations_url,omitempty"`
ReceivedEventsURL *string `json:"received_events_url,omitempty"`
ReposURL *string `json:"repos_url,omitempty"`
StarredURL *string `json:"starred_url,omitempty"`
SubscriptionsURL *string `json:"subscriptions_url,omitempty"`
// Permissions identifies the permissions that a user has on a given
// repository. This is only populated when calling Repositories.ListCollaborators.
Permissions *map[string]bool `json:"permissions,omitempty"`
}