codecov

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package codecov is a client to interact with codecov.io

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitStats

type CommitStats struct {
	Report Report `json:"report"`
}

CommitStats in HTTP response

type HTTPClient

type HTTPClient struct {
	BaseURL    string // e.g. "api.codecov.io"
	HTTPClient *http.Client
}

HTTPClient is codecov HTTP based client

func (HTTPClient) GetRepoStats

func (c HTTPClient) GetRepoStats(owner string, repoName string) (*RepoStats, error)

GetRepoStats makes HTTP call to codecov and parses response

func (HTTPClient) GetRepoStatsFromGitHubURL

func (c HTTPClient) GetRepoStatsFromGitHubURL(ghURL url.URL) (*RepoStats, error)

GetRepoStatsFromGitHubURL is convenience wrapper

type RepoStats

type RepoStats struct {
	Language      string       `json:"language"`      // e.g. "go"
	Branch        string       `json:"branch"`        // e.g. "main"
	Name          string       `json:"name"`          // name of repository
	LatestCommmit *CommitStats `json:"latest_commit"` // can be null for repos registered but no data yet
	RepoURL       url.URL      `json:"-"`             // computed
}

RepoStats codecov stats about single repo

type Report

type Report struct {
	Totals Totals `json:"totals"`
}

Report in HTTP response

type Totals

type Totals struct {
	NumFiles uint    `json:"files"`
	NumLines uint    `json:"lines"`
	Coverage float64 `json:"coverage"`
}

Totals in HTTP response

Jump to

Keyboard shortcuts

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