repodata

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterRepos

func FilterRepos(repos []*github.Repository) []*github.Repository

FilterRepos returns a new array of repo structs that only has non-archived repos

func GetRepos

func GetRepos(githubOrganization string) ([]*github.Repository, error)

GetRepos retrieves the repo data and places it into an array

func Transform

func Transform(repos []*github.Repository) ([]map[string]interface{}, error)

Transform takes in an array of repo structs and transforms it into an array of repo maps with attributes as strings

func ValidateInputFields

func ValidateInputFields(fields string) ([]string, error)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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