{"modulePath":"github.com/unbindapp/unbind-api","version":"v0.0.21","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Types\n\n```go\ntype DefaultPermissions struct {\n\tContents     string `json:\"contents\"`\n\tIssues       string `json:\"issues\"`\n\tMetadata     string `json:\"metadata\"`\n\tPullRequests string `json:\"pull_requests\"`\n\tMembers      string `json:\"members,omitempty\"`\n}\n```\nDefaultPermissions contains permission settings\n\n```go\ntype GitHubAppManifest struct {\n\tName               string             `json:\"name\"`\n\tDescription        string             `json:\"description\"`\n\tURL                string             `json:\"url\"`\n\tHookAttributes     HookAttributes     `json:\"hook_attributes\"`\n\tRedirectURL        string             `json:\"redirect_url\"`\n\tSetupUrl           string             `json:\"setup_url\"`\n\tPublic             bool               `json:\"public\"`\n\tDefaultPermissions DefaultPermissions `json:\"default_permissions\"`\n\tDefaultEvents      []string           `json:\"default_events\"`\n}\n```\nGitHubAppManifest represents the structure for GitHub App manifest\n\n```go\ntype GithubBranch struct {\n\tName      string `json:\"name\"`\n\tRef       string `json:\"ref\"`\n\tProtected bool   `json:\"protected\"`\n\tSHA       string `json:\"sha\"`\n}\n```\nGithubBranch contains information about a branch\n\n```go\ntype GithubClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGithubClient(githubURL string, cfg *config.Config) *GithubClient\n```\n\n```go\nfunc (self *GithubClient) ClonePublicRepository(ctx context.Context, repoURL string, refName string, commitSHA string) (string, error)\n```\nClonePublicRepository clones a public repository without authentication\n\n```go\nfunc (self *GithubClient) CloneRepository(ctx context.Context, appID, installationID int64, appPrivateKey string, repoURL string, refName string, commitSHA string) (string, error)\n```\nCloneRepository clones a repository with optional authentication\n\n```go\nfunc (self *GithubClient) CreateAppManifest(redirectUrl string, setupUrl string, forOrganization bool) (manifest *GitHubAppManifest, appName string, err error)\n```\nCreateAppManifest generates the GitHub App manifest\n\n```go\nfunc (self *GithubClient) GetAuthenticatedClient(ctx context.Context, appID int64, installationID int64, appPrivateKey string) (*github.Client, error)\n```\n\n```go\nfunc (self *GithubClient) GetCommitSummary(ctx context.Context, installation *ent.GithubInstallation, owner, repo string, branchOrSHA string, isCommitSHA bool) (commitSHA, commitMessage string, committer *schema.GitCommitter, err error)\n```\nGet branch head summary - sha, message, author GetCommitSummary - get summary for a specific commit or branch head\n\n```go\nfunc (self *GithubClient) GetInstallationToken(ctx context.Context, appID int64, installationID int64, appPrivateKey string) (string, error)\n```\nGet the token we can use to authenticate with GitHub\n\n```go\nfunc (self *GithubClient) GetRepositoryDetail(ctx context.Context, installation *ent.GithubInstallation, owner, repo string) (*GithubRepositoryDetail, error)\n```\nGet details for a repository\n\n```go\nfunc (self *GithubClient) ManifestCodeConversion(ctx context.Context, code string) (*github.AppConfig, error)\n```\nManifestCodeConversion gets app configruation from github using the code\n\n```go\nfunc (self *GithubClient) ReadUserAdminOrganizations(ctx context.Context, installation *ent.GithubInstallation) ([]*github.Organization, error)\n```\n\n```go\nfunc (self *GithubClient) ReadUserAdminRepositories(ctx context.Context, installations []*ent.GithubInstallation) ([]*GithubRepository, error)\n```\nRead user's admin repositories (that they can configure CI/CD on)\n\n```go\nfunc (self *GithubClient) VerifyRepositoryAccess(ctx context.Context, installation *ent.GithubInstallation, owner, repo string) (canAccess bool, repoUrl, defaultBranch string, err error)\n```\nVerifyRepositoryAccess with resource cleanup\n\n```go\ntype GithubRepository struct {\n\tID             int64                 `json:\"id\"`\n\tInstallationID int64                 `json:\"installation_id\"`\n\tName           string                `json:\"name\"`\n\tFullName       string                `json:\"full_name\"`\n\tHTMLURL        string                `json:\"html_url\"`\n\tCloneURL       string                `json:\"clone_url\"`\n\tHomePage       string                `json:\"homepage\"`\n\tOwner          GithubRepositoryOwner `json:\"owner\"`\n\tUpdatedAt      time.Time             `json:\"updated_at\"`\n}\n```\n\n```go\ntype GithubRepositoryDetail struct {\n\tID              int64                  `json:\"id\"`\n\tInstallationID  int64                  `json:\"installationId\"`\n\tName            string                 `json:\"name\"`\n\tFullName        string                 `json:\"fullName\"`\n\tDescription     string                 `json:\"description\"`\n\tURL             string                 `json:\"url\"`\n\tHTMLURL         string                 `json:\"htmlUrl\"`\n\tDefaultBranch   string                 `json:\"defaultBranch\"`\n\tLanguage        string                 `json:\"language\"`\n\tPrivate         bool                   `json:\"private\"`\n\tFork            bool                   `json:\"fork\"`\n\tArchived        bool                   `json:\"archived\"`\n\tDisabled        bool                   `json:\"disabled\"`\n\tSize            int                    `json:\"size\"`\n\tStargazersCount int                    `json:\"stargazersCount\"`\n\tWatchersCount   int                    `json:\"watchersCount\"`\n\tForksCount      int                    `json:\"forksCount\"`\n\tOpenIssuesCount int                    `json:\"openIssuesCount\"`\n\tCreatedAt       time.Time              `json:\"createdAt\"`\n\tUpdatedAt       time.Time              `json:\"updatedAt\"`\n\tPushedAt        time.Time              `json:\"pushedAt\"`\n\tBranches        []*GithubBranch        `json:\"branches\"`\n\tTags            []*GithubTag           `json:\"tags\"`\n\tOwner           *GithubRepositoryOwner `json:\"owner\"`\n}\n```\n! Getting repository details GithubRepositoryDetail contains detailed information about a repository\n\n```go\ntype GithubRepositoryOwner struct {\n\tID        int64  `json:\"id\"`\n\tName      string `json:\"name\"`\n\tLogin     string `json:\"login\"`\n\tAvatarURL string `json:\"avatar_url\"`\n}\n```\n\\* Formatting\n\n```go\ntype GithubTag struct {\n\tName string `json:\"name\"`\n\tRef  string `json:\"ref\"`\n\tSHA  string `json:\"sha\"`\n}\n```\nGithubTag contains information about a tag\n\n```go\ntype HookAttributes struct {\n\tURL string `json:\"url\"`\n}\n```\nHookAttributes contains webhook configuration\n\n","path":"github.com/unbindapp/unbind-api/internal/integrations/github","name":"github","synopsis":"","isRedistributable":true}
