github

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const GitHub string = "github"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Token string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, token string, domain string) (*Client, error)

func (*Client) GetOrgActionsPermissions

func (c *Client) GetOrgActionsPermissions(ctx context.Context, org string) (*github.ActionsPermissions, error)

func (*Client) GetOrgRepos

func (c *Client) GetOrgRepos(ctx context.Context, org string) <-chan analyze.RepoBatch

func (*Client) GetOrgWorkflowsPermissions

func (c *Client) GetOrgWorkflowsPermissions(ctx context.Context, org string) (*github.DefaultWorkflowPermissionOrganization, error)

func (*Client) GetRepoActionsPermissions

func (c *Client) GetRepoActionsPermissions(ctx context.Context, org string, repo string) (*github.ActionsPermissionsRepository, error)

func (*Client) GetRepoWorkflowsPermissions

func (c *Client) GetRepoWorkflowsPermissions(ctx context.Context, org string, repo string) (*github.DefaultWorkflowPermissionRepository, error)

func (*Client) GetRepository

func (c *Client) GetRepository(ctx context.Context, owner, name string) (*GithubRepository, error)

type GithubRepository

type GithubRepository struct {
	analyze.Repository
	NameWithOwner  string `graphql:"nameWithOwner"`
	IsFork         bool   `graphql:"isFork"`
	IsPrivate      bool   `graphql:"isPrivate"`
	IsMirror       bool   `graphql:"isMirror"`
	IsDisabled     bool   `graphql:"isDisabled"`
	IsEmpty        bool   `graphql:"isEmpty"`
	IsTemplate     bool   `graphql:"isTemplate"`
	IsArchived     bool   `graphql:"isArchived"`
	StargazerCount int    `graphql:"stargazerCount"`
	ForkCount      int    `graphql:"forkCount"`
	Owner          struct {
		Organization struct {
			DatabaseId int `graphql:"databaseId"`
		} `graphql:"... on Organization"`
		User struct {
			DatabaseId int `graphql:"databaseId"`
		} `graphql:"... on User"`
	} `graphql:"owner"`
	DatabaseId       int `graphql:"databaseId"`
	RepoSize         int `graphql:"diskUsage"` // kilobytes
	DefaultBranchRef struct {
		Name string `graphql:"name"`
	} `graphql:"defaultBranchRef"`
	HasIssues       bool `graphql:"hasIssuesEnabled"`
	HasWiki         bool `graphql:"hasWikiEnabled"`
	HasDiscussions  bool `graphql:"hasDiscussionsEnabled"`
	PrimaryLanguage struct {
		Name string `graphql:"name"`
	} `graphql:"primaryLanguage"`
	License struct {
		Name string `graphql:"name"`
	} `graphql:"licenseInfo"`
	Issues struct {
		TotalCount int `graphql:"totalCount"`
	} `graphql:"issues"`
}

func (GithubRepository) BuildGitURL

func (gh GithubRepository) BuildGitURL(baseURL string) string

func (GithubRepository) GetDefaultBranch added in v0.15.1

func (gh GithubRepository) GetDefaultBranch() string

func (GithubRepository) GetForksCount added in v0.15.1

func (gh GithubRepository) GetForksCount() int

func (GithubRepository) GetHasDiscussion added in v0.15.1

func (gh GithubRepository) GetHasDiscussion() bool

func (GithubRepository) GetHasIssues added in v0.15.1

func (gh GithubRepository) GetHasIssues() bool

func (GithubRepository) GetHasWiki added in v0.15.1

func (gh GithubRepository) GetHasWiki() bool

func (GithubRepository) GetIsEmpty added in v0.15.1

func (gh GithubRepository) GetIsEmpty() bool

func (GithubRepository) GetIsFork added in v0.10.0

func (gh GithubRepository) GetIsFork() bool

func (GithubRepository) GetIsTemplate added in v0.15.1

func (gh GithubRepository) GetIsTemplate() bool

func (GithubRepository) GetLicense added in v0.15.1

func (gh GithubRepository) GetLicense() string

func (GithubRepository) GetOpenIssuesCount added in v0.15.1

func (gh GithubRepository) GetOpenIssuesCount() int

func (GithubRepository) GetOrganizationID added in v0.15.1

func (gh GithubRepository) GetOrganizationID() int

func (GithubRepository) GetPrimaryLanguage added in v0.15.1

func (gh GithubRepository) GetPrimaryLanguage() string

func (GithubRepository) GetProviderName

func (gh GithubRepository) GetProviderName() string

func (GithubRepository) GetRepoIdentifier

func (gh GithubRepository) GetRepoIdentifier() string

func (GithubRepository) GetRepositoryID added in v0.15.1

func (gh GithubRepository) GetRepositoryID() int

func (GithubRepository) GetSize added in v0.15.1

func (gh GithubRepository) GetSize() int

func (GithubRepository) GetStarsCount added in v0.15.1

func (gh GithubRepository) GetStarsCount() int

type RateLimitError added in v0.15.1

type RateLimitError struct {
	RetryAfter string
	Err        error
}

func (*RateLimitError) Error added in v0.15.1

func (e *RateLimitError) Error() string

func (*RateLimitError) Unwrap added in v0.15.1

func (e *RateLimitError) Unwrap() error

type ScmClient

type ScmClient struct {
	analyze.ScmClient
	// contains filtered or unexported fields
}

func NewGithubSCMClient

func NewGithubSCMClient(ctx context.Context, baseURL string, token string) (*ScmClient, error)

func (*ScmClient) GetOrgRepos

func (s *ScmClient) GetOrgRepos(ctx context.Context, org string) <-chan analyze.RepoBatch

func (*ScmClient) GetProviderBaseURL

func (s *ScmClient) GetProviderBaseURL() string

func (*ScmClient) GetProviderName

func (s *ScmClient) GetProviderName() string

func (*ScmClient) GetProviderVersion

func (s *ScmClient) GetProviderVersion(ctx context.Context) (string, error)

func (*ScmClient) GetRepo

func (s *ScmClient) GetRepo(ctx context.Context, org string, name string) (analyze.Repository, error)

func (*ScmClient) GetToken

func (s *ScmClient) GetToken() string

func (*ScmClient) ParseRepoAndOrg

func (s *ScmClient) ParseRepoAndOrg(repoString string) (string, string, error)

Jump to

Keyboard shortcuts

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