github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	API      *gh.Client
	Username string
}

Client wraps the GitHub API client with the target username.

func NewClient

func NewClient(token, username string) *Client

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) Context

func (c *Client) Context() context.Context

Context returns a background context.

func (*Client) EnsureProfileRepo

func (c *Client) EnsureProfileRepo() error

EnsureProfileRepo checks if the username/username repo exists, creates it if not.

func (*Client) FetchAllRepos

func (c *Client) FetchAllRepos() ([]Repo, error)

FetchAllRepos retrieves all owned, non-fork repositories with pagination.

func (*Client) FetchProfile

func (c *Client) FetchProfile() (*Profile, error)

FetchProfile retrieves the GitHub user profile.

func (*Client) FetchRepoLanguages

func (c *Client) FetchRepoLanguages(repoName string) (map[string]int, error)

FetchRepoLanguages retrieves the language breakdown for a repository.

func (*Client) PushReadme

func (c *Client) PushReadme(content string) error

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
}

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.

Jump to

Keyboard shortcuts

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