Documentation
¶
Index ¶
- Constants
- type Annotation
- func DiffAnnotation(field string, oldVal, newVal any, valueType string) Annotation
- func New(name, atype string, value any) Annotation
- func NewWithAnalyzer(name, atype string, value any, analyzerID string) Annotation
- func RiskAnnotation(level Risk) Annotation
- func SeverityAnnotation(level Severity) Annotation
- func ValueTypeAnnotation(valueType string) Annotation
- type Annotations
- type DiffValue
- type Risk
- type Severity
Constants ¶
const ( AnnotationSeverityName = "cld.severity" AnnotationSeverityType = "enum" AnnotationRiskName = "cld.risk" AnnotationRiskType = "enum" )
const ( AnnotationValueTypeName = "cld.value_type" AnnotationValueTypeType = "string" )
Value type annotation. Analyzers set this to describe the semantic type of a decoded parameter value. The renderer uses this to decide how to format the value for display.
const ( AnnotationDiffName = "cld.diff" AnnotationDiffType = "diff" )
Diff annotation. Analyzers use this to express a value change (old -> new).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
func DiffAnnotation ¶ added in v0.82.3
func DiffAnnotation(field string, oldVal, newVal any, valueType string) Annotation
DiffAnnotation creates a structured diff annotation.
func New ¶
func New(name, atype string, value any) Annotation
New creates a new annotation with the given name, type, and value.
func NewWithAnalyzer ¶
func NewWithAnalyzer(name, atype string, value any, analyzerID string) Annotation
NewWithAnalyzer creates a new annotation tagged with the ID of the analyzer that produced it.
func RiskAnnotation ¶
func RiskAnnotation(level Risk) Annotation
RiskAnnotation creates an annotation indicating risk level.
func SeverityAnnotation ¶
func SeverityAnnotation(level Severity) Annotation
SeverityAnnotation creates an annotation indicating analysis severity.
func ValueTypeAnnotation ¶
func ValueTypeAnnotation(valueType string) Annotation
ValueTypeAnnotation describes the semantic type of a parameter value. The analyzer knows what the raw decoded value represents (e.g., an Ethereum address, a token amount) and expresses that as a value type. The renderer reads this and decides how to format it for display. Examples: "ethereum.address", "ethereum.uint256", "hex", "truncate:20".
type Annotations ¶
type Annotations []Annotation