Skip to content

Client library for the Codecov API

License

Notifications You must be signed in to change notification settings

taiidani/go-codecov

Repository files navigation

Codecov

Go codecov

This library is made to access the Codecov REST API, allowing programmatic management of the resources exposed through it.

Using The Library

First, generate a Codecov API token for your user at https://codecov.io/account/gh/<user>/access. You will need it in order to authenticate against the API.

Bring the library into your project with:

go get github.com/taiidani/go-codecov

And that's it!

Examples

Listing all repositories for your user:

c := codecov.NewClient("<token>")
repos, err := c.ListRepositories(context.Background(), "<username/org>")
if err != nil {
    panic(err)
}

for _, repo := range repos {
    fmt.Println("%#v", repo)
}

Extracting data for a single repository:

c := codecov.NewClient("<token>")
repo, err := c.GetRepository(context.Background(), "<username/org>", "<repo>")
if err != nil {
    panic(err)
}

fmt.Println("%#v", repo)

Contributing

Issues and Pull Requests are welcome! If you would like to test locally, fork and clone this repository, then run:

go test ./...

Releases

No releases published

Packages

No packages published

Languages