repos

package
v0.0.0-...-b0fec18 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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.

func (*GithubClient) GetReadme

func (g *GithubClient) GetReadme(ctx context.Context, username string, name string) (string, error)

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

Jump to

Keyboard shortcuts

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