package
0.19.0
Repository: https://github.com/hashicorp/copywrite.git
Documentation: pkg.go.dev

# README

.repodata Parser

The repodata module is designed to take parameters specifying how to filter a list of HashiCorp github repos. It does this by grabbing the repo data itself through a go package called go-github that allows the module to utilize the github cli to make the required api call. The filtering and compiling is then done within the module.

An example invocation of the module might look like the following:

copywrite report

Because there are no specific filters stated in this call, the default filters, namely Name, License and HTMLURL, will be used on the data

An example invocation of the module with custom filters might look like the following:

copywrite parse --fields Name,Language,License,UpdatedAt

Compatiblity

The module currently supports data types of *string,*License and *Timestamp only. More can and will be implemented in the future. All data types are listed here. The module also only supports a csv as an output file, but it is designed to allow for other output files to be implemented as well.

# Functions

FilterRepos returns a new array of repo structs that only has non-archived repos.
GetRepos retrieves the repo data and places it into an array.
Transform takes in an array of repo structs and transforms it into an array of repo maps with attributes as strings.
ValidateInputFields takes the module input flag string, splits it by comma, and then checks to make sure each data type exists in the Repository struct.