Documentation
¶
Index ¶
- func BuildPages(projectDir string, allReports map[int]constants.Year) error
- func CopyResultsFileIntoPages(gitDir, filename string, resultsFile *os.File) error
- func FetchExistingReports(gitDir string) ([]string, error)
- func FetchPagesRepo(o *flags.PublishOptions) (string, *git.Repository, error)
- func GenerateHTMLTemplate(baseDir string, allReports map[int]constants.Year) error
- func GenerateJSTemplates(baseDir string, allReports map[int]constants.Year) error
- func NewPublishCommand() *cobra.Command
- func PagesCleanup(pagesDir string)
- func ParseReports(reports []string, img *Image) (map[int]constants.Year, error)
- func PublishPages(repository *git.Repository, gitPagesPath string) error
- type Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPages ¶
BuildPages will generate all the pages required for GitHub Pages.
func CopyResultsFileIntoPages ¶
CopyResultsFileIntoPages copies the results of the recent scan into the relevant location for the static site to be able to display them.
func FetchExistingReports ¶
FetchExistingReports runs to collect all reports from the results directory so that they can be parsed for later usage.
func FetchPagesRepo ¶
func FetchPagesRepo(o *flags.PublishOptions) (string, *git.Repository, error)
FetchPagesRepo pulls the GitHub pages repo locally for modification.
func GenerateHTMLTemplate ¶
GenerateHTMLTemplate creates the index.html page for the frontend website which displays the CVE data.
func GenerateJSTemplates ¶
GenerateJSTemplates creates all the Javscript files for the frontend website.
func NewPublishCommand ¶
NewPublishCommand creates a command that publishes CVE data to GitHub Pages - this will be deprecated soon
func PagesCleanup ¶
func PagesCleanup(pagesDir string)
PagesCleanup just removes any leftover files/repo so that when running locally the binary doesn't hit a conflict. This ensures that on multiple runs it always ahas the latest code base for the GitHub pages repo.
func ParseReports ¶
ParseReports turns all json files into structs to be used in templating for the static site.
func PublishPages ¶
func PublishPages(repository *git.Repository, gitPagesPath string) error
PublishPages pushes the generated javascript, html and results file to GitHub pages.