annotation

package
v0.81.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationSeverityName = "cld.severity"
	AnnotationSeverityType = "enum"

	AnnotationRiskName = "cld.risk"
	AnnotationRiskType = "enum"
)
View Source
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.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation interface {
	Name() string
	Type() string
	Value() any
	AnalyzerID() string
}

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

type Risk

type Risk string

Risk represents the risk level of an analyzed operation.

const (
	RiskHigh   Risk = "high"
	RiskMedium Risk = "medium"
	RiskLow    Risk = "low"
)

type Severity

type Severity string

Severity represents the severity level of an analysis finding.

const (
	SeverityError   Severity = "error"
	SeverityWarning Severity = "warning"
	SeverityInfo    Severity = "info"
	SeverityDebug   Severity = "debug"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL