Documentation ¶
Index ¶
- type GithubClient
- func (g *GithubClient) GetAllByUsername(ctx context.Context, username string) ([]Repository, error)
- func (g *GithubClient) GetOneByUsername(ctx context.Context, username string, name string) (Repository, error)
- func (g *GithubClient) GetReadme(ctx context.Context, username string, name string) (string, error)
- type Repository
- type RepositoryClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
func NewGithubClient ¶
func NewGithubClient(httpclient *http.Client, token string) *GithubClient
func (*GithubClient) GetAllByUsername ¶
func (g *GithubClient) GetAllByUsername(ctx context.Context, username string) ([]Repository, error)
GetAllByUsername implements RepositoryClient.
func (*GithubClient) GetOneByUsername ¶
func (g *GithubClient) GetOneByUsername(ctx context.Context, username string, name string) (Repository, error)
GetOneByUsername implements RepositoryClient.
type Repository ¶
type Repository struct { ID int RemoteID string Name string Owner string Description string HTMLURL string CloneURL string CloneSSHURL string IsFork bool ForkURL string }
func (Repository) DisplayName ¶
func (r Repository) DisplayName() string
DisplayName returns the owner and the name of the repository in the format of "owner/name".
type RepositoryClient ¶
type RepositoryClient interface { GetAllByUsername(ctx context.Context, username string) ([]Repository, error) GetOneByUsername(ctx context.Context, username, name string) (Repository, error) // GetReadme returns the README.md content of the repostiroy if it's present. // If the README.md is not present, it returns an empty string. GetReadme(ctx context.Context, username, name string) (string, error) }
Click to show internal directories.
Click to hide internal directories.