customGithub

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckSuite

type CheckSuite struct {
	CheckRuns checkRuns `graphql:"checkRuns (first: 100)"`
}

type GithubClient

type GithubClient struct {
}

func (*GithubClient) FetchCommits

func (c *GithubClient) FetchCommits(
	owner string,
	repo string,
	token string,
	hashesToFetch []string,
) ([]*model.Commit, error)

FetchCommits fetches Github commits and their statuses

Getting multiple commits by hash
query {
  viewer {
    login
  }
  rateLimit {
    limit
    cost
    remaining
    resetAt
  }
  repository(owner: "laszlocph", name: "aedes") {
     a: object(oid: "25a913a5e052d3f5b9c4880377542f3ed8389d2b") {
      ... on Commit {
        oid
        message
        authoredDate
        status {
          state
          contexts {
            context
            createdAt
            state
            targetUrl
          }
        }
      }
    }
    b: object(oid: "3396bc4fae754b5f55de23f49f973ddca70295d7") {
      ... on Commit {
        oid
        message
        authoredDate
        status {
          state
          contexts {
            context
            createdAt
            state
            targetUrl
          }
        }
        checkSuites(first: 100){
          nodes {
            checkRuns (first: 100) {
              nodes {
                permalink
                name
                status
                startedAt
                completedAt
              }
            }
          }
        }
        statusCheckRollup{
          state
          contexts(first: 100) {
            nodes {
              __typename
              ... on CheckRun {
                name
                detailsUrl
                completedAt
                status
              }
              ... on StatusContext {
                context
                createdAt
                state
                targetUrl
              }
            }
          }
        }
      }
    }
  }
}

func (*GithubClient) GetAppNameAndAppSettingsURLs added in v0.4.0

func (c *GithubClient) GetAppNameAndAppSettingsURLs(appToken string, ctx context.Context) (string, string, string, error)

func (*GithubClient) OrgRepos added in v0.3.0

func (c *GithubClient) OrgRepos(installationToken string) ([]string, error)

OrgRepos returns all repos of an org using the installation

type GithubOrgTokenManager

type GithubOrgTokenManager struct {
	// contains filtered or unexported fields
}

GithubOrgTokenManager maintains a valid git org/non-impersonated token

func NewGithubOrgTokenManager

func NewGithubOrgTokenManager(config *config.Config) (*GithubOrgTokenManager, error)

func (*GithubOrgTokenManager) AppToken added in v0.4.0

func (tm *GithubOrgTokenManager) AppToken() (string, error)

appToken returns a signed JWT apptoken for the Github app Use it to have unimpersonated access of Github resources

func (*GithubOrgTokenManager) Token

func (tm *GithubOrgTokenManager) Token() (string, string, error)

Token returns a valid cached orgToken

Jump to

Keyboard shortcuts

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