package
0.0.0-20191015002125-7cc1d6a9b808
Repository: https://github.com/chizhg/pkg.git
Documentation: pkg.go.dev
# README
Tools
Tools package is intended to contain types and public helper methods that provide utilities to solves common requirements across repos. It currently contains following helper methods:
GetDefaultKubePath
: Helper method to retrieve the path for Kubeconfig inside users home directory.GetWebhookServiceIP
: Helper method to retrieve the public IP address for the webhook service. The service is setup as part of the apicoverage-webhook setup.GetResourceCoverage
: Helper method to retrieve Coverage data for a resource passed as parameter. The coverage data is retrieved from the API that is exposed by the HTTP server in Webhook SetupGetAndWriteResourceCoverage
: Helper method that usesGetResourceCoverage
to retrieve resource coverage and writes output to a file.GetTotalCoverage
: Helper method to retrieve total coverage data for a repo. The coverage data is retrieved from the API that is exposed by the HTTP server in Webhook SetupGetAndWriteTotalCoverage
: Helper method that usesGetTotalCoverage
to retrieve total coverage and writes output to a file.
# Functions
Helper function to cleanup any existing Junit XML files.
GetAndWriteResourceCoverage is a helper method that uses GetResourceCoverage to get coverage and write it to a file.
GetAndWriteTotalCoverage uses the GetTotalCoverage method to get total coverage and write it to a output file.
GetDefaultKubePath helper method to fetch kubeconfig path.
GetResourceCoverage is a helper method to get Coverage data for a resource from the service webhook.
GetResourcePercentages calls resource percentage coverage API to retrieve percentage values.
GetTotalCoverage calls the total coverage API to retrieve total coverage values.
GetWebhookServiceIP is a helper method to fetch IP Address of the LoadBalancer webhook service.
WriteResourcePercentages writes CoveragePercentages to junit_xml output file.
# Constants
WebhookResourceCoverageEndPoint constant for resource coverage API endpoint.
WebhookResourcePercentageCoverageEndPoint constant for ResourcePercentageCoverage API endpoint.
WebhookTotalCoverageEndPoint constant for total coverage API endpoint.