github

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayBatchResults

func DisplayBatchResults(results []*BatchOperation, operation string)

DisplayBatchResults displays batch operation results

func GetTokenFromGH

func GetTokenFromGH() (string, error)

GetTokenFromGH retrieves the GitHub token from gh CLI

Types

type BatchOperation

type BatchOperation struct {
	Username string
	Success  bool
	Error    error
}

BatchOperation represents a batch operation result

type BatchOptions

type BatchOptions struct {
	Concurrency int
	RateLimit   time.Duration
	DryRun      bool
	Progress    bool
}

BatchOptions represents options for batch processing

type BatchProcessor

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

BatchProcessor handles concurrent batch operations

func NewBatchProcessor

func NewBatchProcessor(gc *GitHubClient, opts *BatchOptions) *BatchProcessor

NewBatchProcessor creates a new batch processor

func (*BatchProcessor) BatchCheckFollowers

func (bp *BatchProcessor) BatchCheckFollowers(ctx context.Context, usernames []string) map[string]bool

BatchCheckFollowers checks if users follow you concurrently

func (*BatchProcessor) BatchFetchUsers

func (bp *BatchProcessor) BatchFetchUsers(ctx context.Context, usernames []string) map[string]*github.User

BatchFetchUsers fetches multiple users concurrently

func (*BatchProcessor) BatchFollow

func (bp *BatchProcessor) BatchFollow(ctx context.Context, usernames []string, opts *BatchOptions) []*BatchOperation

BatchFollow follows multiple users concurrently

func (*BatchProcessor) BatchUnfollow

func (bp *BatchProcessor) BatchUnfollow(ctx context.Context, usernames []string, opts *BatchOptions) []*BatchOperation

BatchUnfollow unfollows multiple users concurrently

type BatchResult

type BatchResult struct {
	Total        int
	Success      int
	Failed       int
	Errors       []error
	Duration     time.Duration
	ErrorsByUser map[string]error
}

BatchResult represents batch operation results

func GetBatchStats

func GetBatchStats(results []*BatchOperation) *BatchResult

GetBatchStats returns statistics from batch results

type GitHubClient

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

GitHubClient wraps the GitHub API client with follow-specific operations

func NewGitHubClient

func NewGitHubClient(token string, hostname string) *GitHubClient

NewGitHubClient creates a new GitHub API client

func (*GitHubClient) BatchFollow

func (gc *GitHubClient) BatchFollow(ctx context.Context, usernames []string) ([]string, []error)

BatchFollow follows multiple users

func (*GitHubClient) BatchUnfollow

func (gc *GitHubClient) BatchUnfollow(ctx context.Context, usernames []string) ([]string, []error)

BatchUnfollow unfollows multiple users

func (*GitHubClient) Follow

func (gc *GitHubClient) Follow(ctx context.Context, username string) error

Follow follows a GitHub user

func (*GitHubClient) GetAuthenticatedUser

func (gc *GitHubClient) GetAuthenticatedUser(ctx context.Context) (*github.User, error)

GetAuthenticatedUser retrieves information about the authenticated user

func (*GitHubClient) GetFollowers

func (gc *GitHubClient) GetFollowers(ctx context.Context) ([]*github.User, error)

GetFollowers retrieves all followers of the authenticated user

func (*GitHubClient) GetFollowing

func (gc *GitHubClient) GetFollowing(ctx context.Context) ([]*github.User, error)

GetFollowing retrieves all users that the authenticated user is following

func (*GitHubClient) GetUser

func (gc *GitHubClient) GetUser(ctx context.Context, username string) (*github.User, error)

GetUser retrieves information about a specific user

func (*GitHubClient) IsFollowing

func (gc *GitHubClient) IsFollowing(ctx context.Context, username string) (bool, error)

IsFollowing checks if the authenticated user is following a specific user

func (*GitHubClient) SyncFollowing

func (gc *GitHubClient) SyncFollowing(ctx context.Context, localList *models.FollowList) (*models.FollowList, error)

SyncFollowing synchronizes the local follow list with GitHub

func (*GitHubClient) Unfollow

func (gc *GitHubClient) Unfollow(ctx context.Context, username string) error

Unfollow unfollows a GitHub user

Jump to

Keyboard shortcuts

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