Documentation
¶
Index ¶
- func DisplayBatchResults(results []*BatchOperation, operation string)
- func GetTokenFromGH() (string, error)
- type BatchOperation
- type BatchOptions
- type BatchProcessor
- func (bp *BatchProcessor) BatchCheckFollowers(ctx context.Context, usernames []string) map[string]bool
- func (bp *BatchProcessor) BatchFetchUsers(ctx context.Context, usernames []string) map[string]*github.User
- func (bp *BatchProcessor) BatchFollow(ctx context.Context, usernames []string, opts *BatchOptions) []*BatchOperation
- func (bp *BatchProcessor) BatchUnfollow(ctx context.Context, usernames []string, opts *BatchOptions) []*BatchOperation
- type BatchResult
- type GitHubClient
- func (gc *GitHubClient) BatchFollow(ctx context.Context, usernames []string) ([]string, []error)
- func (gc *GitHubClient) BatchUnfollow(ctx context.Context, usernames []string) ([]string, []error)
- func (gc *GitHubClient) Follow(ctx context.Context, username string) error
- func (gc *GitHubClient) GetAuthenticatedUser(ctx context.Context) (*github.User, error)
- func (gc *GitHubClient) GetFollowers(ctx context.Context) ([]*github.User, error)
- func (gc *GitHubClient) GetFollowing(ctx context.Context) ([]*github.User, error)
- func (gc *GitHubClient) GetUser(ctx context.Context, username string) (*github.User, error)
- func (gc *GitHubClient) IsFollowing(ctx context.Context, username string) (bool, error)
- func (gc *GitHubClient) SyncFollowing(ctx context.Context, localList *models.FollowList) (*models.FollowList, error)
- func (gc *GitHubClient) Unfollow(ctx context.Context, username string) error
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 ¶
GetTokenFromGH retrieves the GitHub token from gh CLI
Types ¶
type BatchOperation ¶
BatchOperation represents a batch operation result
type BatchOptions ¶
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 ¶
BatchFollow follows multiple users
func (*GitHubClient) BatchUnfollow ¶
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 ¶
GetAuthenticatedUser retrieves information about the authenticated user
func (*GitHubClient) GetFollowers ¶
GetFollowers retrieves all followers of the authenticated user
func (*GitHubClient) GetFollowing ¶
GetFollowing retrieves all users that the authenticated user is following
func (*GitHubClient) IsFollowing ¶
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