Documentation ¶
Index ¶
- Constants
- Variables
- func FilterSeverityASC(original []string, severityMinLevel string) []string
- func NewJsonWriter(next io.Writer, stripWhitespaces bool) io.Writer
- func RenderDivider() string
- func RenderError(err snyk_errors.Error) string
- func RenderFinding(finding Finding) string
- func RenderFindings(findings []Finding, showIgnored bool, isSeverityThresholdApplied bool) string
- func RenderLink(str string) string
- func RenderSummary(summary *json_schemas.TestSummary, orgName string, testPath string, ...) (string, error)
- func RenderTip(str string) string
- func RenderTitle(str string) string
- type Finding
- type FindingProperty
- type JsonWriter
- type LocalFindingPresenter
- type LocalFindingPresenterOptions
- type PresenterOption
- type SarifPresenter
- type SummaryData
- type TemplateImplFunction
Constants ¶
View Source
const ApplicationJSONMimeType = "application/json"
View Source
const ApplicationSarifMimeType = content_type.SARIF_JSON
View Source
const CONFIG_JSON_STRIP_WHITESPACES = "internal_json_no_whitespaces"
View Source
const DefaultMimeType = "text/cli"
View Source
const NoneMimeType = "unknown"
Variables ¶
View Source
var ApplicationSarifTemplates = []string{
"templates/local_finding.sarif.tmpl",
}
View Source
var DefaultTemplateFiles = []string{
"templates/local_finding.tmpl",
"templates/finding.component.tmpl",
}
DefaultTemplateFiles is an instance of TemplatePathsStruct with the template paths.
Functions ¶
func FilterSeverityASC ¶
func NewJsonWriter ¶
* This Writer can be used to strip away whitespaces from json content to reduce the final size
func RenderDivider ¶
func RenderDivider() string
func RenderError ¶
func RenderError(err snyk_errors.Error) string
func RenderFinding ¶
func RenderFindings ¶
func RenderLink ¶
func RenderSummary ¶
func RenderSummary(summary *json_schemas.TestSummary, orgName string, testPath string, severityMinLevel string) (string, error)
func RenderTitle ¶
Types ¶
type Finding ¶
type Finding struct { ID string Severity string Title string Ignored bool Properties []FindingProperty }
func SortFindings ¶
type FindingProperty ¶
type JsonWriter ¶
type JsonWriter struct {
// contains filtered or unexported fields
}
type LocalFindingPresenter ¶
type LocalFindingPresenter struct { TestPath string Input []*local_models.LocalFinding // contains filtered or unexported fields }
func NewLocalFindingsRenderer ¶
func NewLocalFindingsRenderer(localFindingsDoc []*local_models.LocalFinding, config configuration.Configuration, writer io.Writer, options ...LocalFindingPresenterOptions) *LocalFindingPresenter
func (*LocalFindingPresenter) RegisterMimeType ¶
func (p *LocalFindingPresenter) RegisterMimeType(mimeType string, implFactory TemplateImplFunction) error
func (*LocalFindingPresenter) RenderTemplate ¶
func (p *LocalFindingPresenter) RenderTemplate(templateFiles []string, mimeType string) error
type LocalFindingPresenterOptions ¶
type LocalFindingPresenterOptions func(presentation *LocalFindingPresenter)
func WithRuntimeInfo ¶
func WithRuntimeInfo(ri runtimeinfo.RuntimeInfo) LocalFindingPresenterOptions
type PresenterOption ¶
type PresenterOption func(*SarifPresenter)
func WithIgnored ¶
func WithIgnored(showIgnored bool) PresenterOption
func WithOrgName ¶
func WithOrgName(orgName string) PresenterOption
func WithSeverityThershold ¶
func WithSeverityThershold(severityMinLevel string) PresenterOption
func WithTestPath ¶
func WithTestPath(testPath string) PresenterOption
type SarifPresenter ¶
type SarifPresenter struct { ShowIgnored bool Input sarif.SarifDocument OrgName string TestPath string SeverityMinLevel string }
func SarifTestResults ¶
func SarifTestResults(sarifDocument sarif.SarifDocument, options ...PresenterOption) *SarifPresenter
func (*SarifPresenter) Render ¶
func (p *SarifPresenter) Render() (string, error)
type SummaryData ¶
type SummaryData struct { SummaryTitle string Org string TestPath string Type string TotalIssueCount int IgnoreIssueCount int OpenIssueCountWithSeverities string IgnoredIssueCountWithSeverities string }
func PrepareSummary ¶
func PrepareSummary(summary *json_schemas.TestSummary, orgName string, testPath string, severityMinLevel string) (data SummaryData)
Click to show internal directories.
Click to hide internal directories.