Documentation
¶
Index ¶
- Constants
- Variables
- func FilterSeverityASC(original []string, severityMinLevel string) []string
- func HtmlToAnsi(tag, cssClass, originalContent string) string
- func IsHtml(str string) bool
- func NewJsonWriter(next io.Writer, stripWhitespaces bool) io.Writer
- func RenderDivider() string
- func RenderError(err snyk_errors.Error, ctx context.Context) 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 ElementCallback
- type Finding
- type FindingProperty
- type HTMLpresenter
- type JsonWriter
- type LocalFindingPresenter
- type LocalFindingPresenterOptions
- type SarifPresenter
- type SummaryData
- type TemplateImplFunction
- type UfmPresenter
- type UfmPresenterOptions
Constants ¶
View Source
const ( DedupeByProblemID issueDedupeKey = "problemID" DedupeByID issueDedupeKey = "id" )
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 ApplicationSarifTemplatesUfm = []string{
"templates/ufm.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.
View Source
var DefaultTemplateFilesUfm = []string{
"templates/ufm.human.tmpl",
}
Functions ¶
func FilterSeverityASC ¶
func HtmlToAnsi ¶
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, ctx context.Context) 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 ElementCallback ¶
type Finding ¶
type Finding struct {
ID string
Severity string
Title string
Ignored bool
Properties []FindingProperty
}
type FindingProperty ¶
type HTMLpresenter ¶
type HTMLpresenter struct {
Callback ElementCallback
}
func NewHTMLPresenter ¶
func NewHTMLPresenter(callback ElementCallback) *HTMLpresenter
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 SarifPresenter ¶
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)
type TemplateImplFunction ¶
type UfmPresenter ¶
type UfmPresenter struct {
TestPath string
Input []testapi.TestResult
// contains filtered or unexported fields
}
func NewUfmRenderer ¶
func NewUfmRenderer(results []testapi.TestResult, config configuration.Configuration, writer io.Writer, options ...UfmPresenterOptions) *UfmPresenter
func (*UfmPresenter) RegisterMimeType ¶
func (p *UfmPresenter) RegisterMimeType(mimeType string, implFactory TemplateImplFunction) error
func (*UfmPresenter) RenderTemplate ¶
func (p *UfmPresenter) RenderTemplate(templateFiles []string, mimeType string) error
type UfmPresenterOptions ¶
type UfmPresenterOptions func(presentation *UfmPresenter)
func UfmWithRuntimeInfo ¶
func UfmWithRuntimeInfo(ri runtimeinfo.RuntimeInfo) UfmPresenterOptions
Click to show internal directories.
Click to hide internal directories.