Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charlieegan3/repofiles
Simple library to recursively list files in a GitHub repo and collect the file contents for each.
https://github.com/charlieegan3/repofiles
Last synced: 15 days ago
JSON representation
Simple library to recursively list files in a GitHub repo and collect the file contents for each.
- Host: GitHub
- URL: https://github.com/charlieegan3/repofiles
- Owner: charlieegan3
- Created: 2015-12-22T23:18:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-01T17:50:34.000Z (almost 9 years ago)
- Last Synced: 2023-03-12T05:52:38.701Z (over 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#RepoFiles
Simple library to recursively list files in a GitHub repo and collect the file contents for each. Makes use of the [`trees`](https://developer.github.com/v3/git/trees/) endpoint.
## Usage
```go
package mainimport (
"fmt""github.com/charlieegan3/repofiles"
)func main() {
credentials = Credentials{User: os.Getenv("GITHUB_USER"), Token: os.Getenv("GITHUB_TOKEN")}
repo := repofiles.NewRepo("username", "repoName", "master or SHA")
repo.List(credentials) //collect the list files
files := repo.Files(credentials) //request the contents of each filefmt.Println(files)
}```
Output:
```
[{file1.ext file1content} {file2.ext file1content} ...]
```