github

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDeleteRepoPermissions

func CheckDeleteRepoPermissions(ctx context.Context, client *github.Client) (bool, error)

func DisplayRateLimit

func DisplayRateLimit(ctx context.Context, client *github.Client)
func ExtractLinks(text string) []string

ExtractLinks extracts URLs from text

func FetchCommits

func FetchCommits(ctx context.Context, client *github.Client, owner, repo string, isFork bool, since *time.Time, checkSecrets bool, findLinks bool, cfg *Config) ([]models.CommitInfo, error)

func FetchGists

func FetchGists(ctx context.Context, client *github.Client, username string, cfg *Config) ([]*github.Gist, error)

FetchGists retrieves all public gists for a given username

func FetchOrgRepos

func FetchOrgRepos(ctx context.Context, client *github.Client, orgName string, cfg *Config) ([]*github.Repository, error)

based: unified repo fetching for orgs

func FetchRepos

func FetchRepos(ctx context.Context, client *github.Client, username string, cfg *Config) ([]*github.Repository, error)

func FetchReposWithUser

func FetchReposWithUser(ctx context.Context, client *github.Client, username string, cfg *Config, user *github.User) ([]*github.Repository, error)

func GetGithubClient

func GetGithubClient(token string) *github.Client

func GetToken

func GetToken(c *cli.Context) string

func GetUserByEmail

func GetUserByEmail(ctx context.Context, client *github.Client, email string) (*github.User, error)

func GetUsernameForEmail

func GetUsernameForEmail(ctx context.Context, client *github.Client, email string) (string, error)

func GetUsernameFromEmailSpoof

func GetUsernameFromEmailSpoof(ctx context.Context, client *github.Client, email string, token string) (string, error)

func IsOrganization

func IsOrganization(ctx context.Context, client *github.Client, name string) (bool, error)

IsOrganization checks if the given name belongs to a GitHub organization

func IsValidEmail

func IsValidEmail(input string) bool

func ProcessCommit

func ProcessCommit(commit *gh.RepositoryCommit, checkSecrets bool, cfg *Config) models.CommitInfo

func ProcessGists

func ProcessGists(ctx context.Context, client *gh.Client, gists []*gh.Gist, checkSecrets bool, cfg *Config) map[string]*models.EmailDetails

ProcessGists processes gists for commit information

func ProcessRepos

func ProcessRepos(ctx context.Context, client *gh.Client, repos []*gh.Repository, checkSecrets bool, cfg *Config, targetUserIdentifiers map[string]bool, showTargetOnly bool) map[string]*models.EmailDetails

func ProcessReposLimited

func ProcessReposLimited(ctx context.Context, client *gh.Client, repos []*gh.Repository, checkSecrets bool, cfg *Config, targetUserIdentifiers map[string]bool, showTargetOnly bool) map[string]*models.EmailDetails

ProcessReposLimited processes only recent commits from repos (API-friendly fallback)

func ProcessUserEvents

func ProcessUserEvents(ctx context.Context, client *gh.Client, username string, checkSecrets bool, cfg *Config, targetUserIdentifiers map[string]bool, showTargetOnly bool) map[string]*models.EmailDetails

ProcessUserEvents processes user events using the GitHub Events API (more efficient)

func RateLimitedProcessRepos

func RateLimitedProcessRepos(ctx context.Context, client *gh.Client, repos []*gh.Repository, checkSecrets bool, cfg *Config, targetUserIdentifiers map[string]bool, showTargetOnly bool) map[string]*models.EmailDetails

RateLimitedProcessRepos performs comprehensive contributor enumeration for --deep mode

func UserExists

func UserExists(ctx context.Context, client *github.Client, username string) (bool, error)

func ValidateToken

func ValidateToken(ctx context.Context, client *github.Client) error

Types

type Config

type Config struct {
	MaxRepos              int
	MaxGists              int
	MaxCommits            int
	ShowInteresting       bool
	MaxConcurrentRequests int
	PerPage               int
	SkipNodeModules       bool
	QuickMode             bool
	TimestampAnalysis     bool
}

Config holds configuration for GitHub operations

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a default configuration

type RateLimit

type RateLimit struct {
	Limit     int
	Remaining int
	ResetTime time.Time
}

func GetRateLimit

func GetRateLimit(ctx context.Context, client *github.Client) (*RateLimit, error)

Jump to

Keyboard shortcuts

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