Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwesomeGo ¶
type AwesomeGo struct {
// contains filtered or unexported fields
}
AwesomeGo is the main struct for the awesome-go-ranking package.
func NewAwesomeGo ¶
func NewAwesomeGo(token string, client IGithubClient) *AwesomeGo
NewAwesomeGo creates a new AwesomeGo instance.
func (*AwesomeGo) FetchAndRankRepositories ¶
FetchAndRankRepositories fetches the repositories in the Awesome Go list
func (*AwesomeGo) Repositories ¶
func (ag *AwesomeGo) Repositories() map[string][]Repository
Repositories returns the repositories in the Awesome Go list.
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
GithubClient is a struct that represents a Github client.
func NewGithubClient ¶
func NewGithubClient(token string) *GithubClient
NewGithubClient creates a new GithubClient instance.
func (*GithubClient) FetchReadmeMarkdown ¶
func (ag *GithubClient) FetchReadmeMarkdown(ctx context.Context, owner, repo string) (string, error)
FetchReadmeMarkdown fetches the README.md file of a given repository.
func (*GithubClient) FetchRepository ¶
func (gc *GithubClient) FetchRepository(ctx context.Context, owner, repo string) (*Repository, error)
FetchRepository fetches the repositories from the Github API
type GithubHtmlParserClient ¶
type GithubHtmlParserClient struct { }
GithubHtmlParserClient is a struct that represents a Github client.
func NewGithubHtmlParserClient ¶
func NewGithubHtmlParserClient() *GithubHtmlParserClient
NewGithubHtmlParserClient creates a new GithubHtmlParserClient instance.
func (*GithubHtmlParserClient) FetchReadmeMarkdown ¶
func (ghpc *GithubHtmlParserClient) FetchReadmeMarkdown(ctx context.Context, owner, repo string) (string, error)
FetchReadmeMarkdown fetches the README.md file of a given repository.
func (*GithubHtmlParserClient) FetchRepository ¶
func (ghpc *GithubHtmlParserClient) FetchRepository(ctx context.Context, owner, repo string) (*Repository, error)
FetchRepository fetches the repositories from parsing the HTML page.
type IGithubClient ¶
type IGithubClient interface { // FetchReadmeMarkdown fetches the README.md file of a given repository. FetchReadmeMarkdown(ctx context.Context, owner, repo string) (string, error) // FetchRepository fetches the repositories from the Github API FetchRepository(ctx context.Context, owner, repo string) (*Repository, error) }
IGithubClient is an interface for the Github API
type MockGithubClient ¶
type MockGithubClient struct {
// contains filtered or unexported fields
}
MockGithubClient is a mock Github client
func NewMockGithubClient ¶
func NewMockGithubClient(result *Repository, readme string) *MockGithubClient
NewMockGithubClient creates a new MockGithubClient instance
func (*MockGithubClient) FetchReadmeMarkdown ¶
func (gc *MockGithubClient) FetchReadmeMarkdown(ctx context.Context, owner, repo string) (string, error)
FetchReadmeMarkdown fetches the README.md file of a given repository.
func (*MockGithubClient) FetchRepository ¶
func (gc *MockGithubClient) FetchRepository(ctx context.Context, owner, repo string) (*Repository, error)
FetchRepository fetches the repositories from the Github API