github

package
v0.0.0-...-f74eb5f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	USER_REPOS = "https://api.github.com/users/DnFreddie/repos"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	Owner    string `json:"login"`
	URL      string `json:"clone_url"`
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	Version  string `json:"version"`
	Path     string
}

func NewRepo

func NewRepo(repoPathOrURL string) (*Repo, error)

func (*Repo) Clone

func (r *Repo) Clone(dir string) error

func (Repo) String

func (r Repo) String() string

type RepoExistErr

type RepoExistErr struct {
	// contains filtered or unexported fields
}

func (RepoExistErr) Error

func (e RepoExistErr) Error() string

func (RepoExistErr) Is

func (e RepoExistErr) Is(target error) bool

type RepoManager

type RepoManager struct {
	Repos []Repo
}

func NewRepoManager

func NewRepoManager(url string, client *http.Client) (*RepoManager, error)

func (*RepoManager) FilterByOwner

func (rm *RepoManager) FilterByOwner(owner string) *RepoManager
Example
rm := &RepoManager{
	Repos: []Repo{
		{Name: "repo1", Owner: "owner1"},
		{Name: "repo2", Owner: "owner2"},
		{Name: "repo3", Owner: "owner1"},
	},
}
filtered := rm.FilterByOwner("owner1")
for _, repo := range filtered.Repos {
	fmt.Println(repo.Name)
}
Output:

repo1
repo3

func (*RepoManager) PrintNames

func (rm *RepoManager) PrintNames()

Jump to

Keyboard shortcuts

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