Documentation
¶
Overview ¶
Package exportkit holds the rules every exporter of the interoperability adapters (v2/interop/<format>, nested modules of this repository) follows. It is internal: not part of the module's API.
Index ¶
- Constants
- Variables
- func FindAsset(r *ctis.Report, id string) *ctis.Asset
- func Finding(f *ctis.Finding) (ctis.Finding, error)
- func FormatScore(v float64) string
- func FormatTime(t *time.Time) string
- func Marshal(v any) ([]byte, error)
- func MaskSensitiveSpans(value, pointer string, spans []ctis.SensitiveSpan) string
- func PropString(p ctis.Properties, key string) string
Constants ¶
const MaxBytes = 256 << 20
MaxBytes is the largest encoded output an exporter returns. It is the importer's default input limit, so an export can be read back.
Variables ¶
var ErrNilReport = errors.New("ctis: nil report")
ErrNilReport is returned for a nil report.
var ErrTooLarge = errors.New("ctis: export exceeds the size limit (MaxBytes)")
ErrTooLarge is returned when the encoded output would exceed MaxBytes.
Functions ¶
func Finding ¶
Finding returns a deep copy of f that is safe to write out: a secret finding is redacted (ctis.RedactSecretFinding), and the caller's report is never modified.
func FormatScore ¶
FormatScore writes a score with the fewest digits that read back equal.
func FormatTime ¶
FormatTime writes a time as RFC 3339 in UTC, or "" for nil/zero.
func MaskSensitiveSpans ¶
func MaskSensitiveSpans(value, pointer string, spans []ctis.SensitiveSpan) string
MaskSensitiveSpans masks, in value, the ranges the evidence item marks sensitive at pointer: a span without offsets masks the whole value.
func PropString ¶
func PropString(p ctis.Properties, key string) string
PropString returns the string value of a property, or "".
Types ¶
This section is empty.