Documentation
¶
Index ¶
- type Client
- func (c *Client) Context() context.Context
- func (c *Client) EnsureProfileRepo() error
- func (c *Client) FetchAllRepos() ([]Repo, error)
- func (c *Client) FetchProfile() (*Profile, error)
- func (c *Client) FetchRepoLanguages(repoName string) (map[string]int, error)
- func (c *Client) PushReadme(content string) error
- type Profile
- type Repo
- type SocialAccount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client wraps the GitHub API client with the target username.
func NewClient ¶
NewClient creates a GitHub client for the given username. If token is empty, the client is unauthenticated (public API only, lower rate limits).
func (*Client) EnsureProfileRepo ¶
EnsureProfileRepo checks if the username/username repo exists, creates it if not.
func (*Client) FetchAllRepos ¶
FetchAllRepos retrieves all owned, non-fork repositories with pagination.
func (*Client) FetchProfile ¶
FetchProfile retrieves the GitHub user profile and social accounts.
func (*Client) FetchRepoLanguages ¶
FetchRepoLanguages retrieves the language breakdown for a repository.
func (*Client) PushReadme ¶
PushReadme creates or updates the README.md in the profile repo.
type Profile ¶
type Profile struct {
Login string
Name string
Bio string
Location string
Blog string
Twitter string
AvatarURL string
Followers int
Following int
PublicRepos int
SocialAccounts []SocialAccount
}
Profile holds the relevant user profile data.
type Repo ¶
type Repo struct {
Name string
Description string
URL string
Stars int
Forks int
Language string
Languages map[string]int
PushedAt time.Time
Fork bool
Archived bool
}
Repo holds relevant repository data.
type SocialAccount ¶ added in v0.2.0
SocialAccount represents a linked social account on a GitHub profile.
func (SocialAccount) DisplayName ¶ added in v0.2.0
func (a SocialAccount) DisplayName() string
DisplayName returns a human-readable name for the social account.
func (SocialAccount) SocialBadge ¶ added in v0.2.0
func (a SocialAccount) SocialBadge() string
SocialBadge returns a Shields.io badge URL for a social account.
func (*SocialAccount) UnmarshalJSON ¶ added in v0.2.0
func (a *SocialAccount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.