Documentation
¶
Index ¶
- func CVESubPath(cveID string) (string, error)
- func CompileToFile(f *os.File, path string, t interface{}) error
- func CvebaseURL(cveID string) string
- func DirExists(path string) (bool, error)
- func Exists(path string) (bool, error)
- func ParseMDFile(r io.Reader, tPtr interface{}) error
- func PathIsType(p string) (string, error)
- func ResearcherSubPath(rAlias string) string
- func SortUniqStrings(inSlice []string) []string
- func UniqStrings(s []string) []string
- func WantPath(p string) (string, error)
- type CVE
- type GitOpts
- type Repo
- type Researcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CVESubPath ¶
CVESubPath converts a CVE ID to cve relative path starting with year subdirectory
func CvebaseURL ¶
func ParseMDFile ¶
ParseMDFile reads markdown file contents containing YAML and markdown and returns either CVE or Researcher data struct
func PathIsType ¶
PathIsType returns either "cve" or "researcher" based on directory structure of given relative path to cve or researcher file
func ResearcherSubPath ¶
func SortUniqStrings ¶
SortUniqStrings sorts and removes duplicates of a string slice
func UniqStrings ¶
UniqStrings improves implementation of removeDuplicates avoids the excess work done by your use of append to remove elements
Types ¶
type CVE ¶
type CVE struct {
CVEID string `json:"-" yaml:"id"`
Pocs []string `json:"pocs,omitempty" yaml:"pocs,omitempty"`
Courses []string `json:"courses,omitempty" yaml:"courses,omitempty"`
Writeups []string `json:"writeups,omitempty" yaml:"writeups,omitempty"`
Advisory string `json:"advisory,omitempty" yaml:"-"`
}
type Repo ¶
type Repo struct {
DirPath string
// contains filtered or unexported fields
}
func (*Repo) CheckFilenamesFromCommit ¶
func (*Repo) GetFullPath ¶
GetFullPath converts relative file path to full path including the base directory
func (*Repo) ScanCVE ¶
ScanCVE returns a channel of all CVE objects in the repo. A buffered error channel returns any errors encountered during the dirwalk.
func (*Repo) ScanTree ¶
func (r *Repo) ScanTree(done <-chan struct{}, subDir string, fileExt string) (<-chan string, <-chan error)
ScanTree generates a channel of filepaths from sub-directory in the repo, filtering paths with provided file extension e.g. `.md`. A buffered error channel returns any errors encountered during the dirwalk.
type Researcher ¶
type Researcher struct {
Name string `json:"name" yaml:"name"`
Alias string `json:"alias" yaml:"alias"`
Nationality string `json:"nationality" yaml:"nationality,omitempty"`
Website string `json:"website" yaml:"website,omitempty"`
Twitter string `json:"twitter" yaml:"twitter,omitempty"`
Github string `json:"github" yaml:"github,omitempty"`
Linkedin string `json:"linkedin" yaml:"linkedin,omitempty"`
Hackerone string `json:"hackerone" yaml:"hackerone,omitempty"`
Bugcrowd string `json:"bugcrowd" yaml:"bugcrowd,omitempty"`
CVEs []string `json:"cves" yaml:"cves"`
Bio string `json:"bio" yaml:"-"`
}
func ParseResearcherMDFile ¶
func ParseResearcherMDFile(reader io.Reader) (researcher Researcher, err error)
ParseResearcherMDFile reads markdown file contents containing YAML and markdown and returns Researcher data struct