Documentation
¶
Index ¶
- Constants
- Variables
- func Identity(node Node) (string, error)
- func IdentityV2(p *graphv2.Producer, repository, sourceID, occurrence string) (string, error)
- func MarshalV2(a *graphv2.Artifact, limits Limits) ([]byte, error)
- func ParseV2(data []byte, limits Limits) (*graphv2.Artifact, error)
- func SemanticHashV2(a *graphv2.Artifact, limits Limits) ([]byte, error)
- func SourceOffset(source string, p *graphv2.Position) (int, error)
- func Validate(artifact Artifact, limits Limits) error
- func ValidateV2(a *graphv2.Artifact, limits Limits) error
- type Analyzer
- type Artifact
- type Edge
- type EdgeKind
- type Limits
- type Manifest
- type Node
- type NodeKind
- type Range
- type Relationship
- type SCIPRepository
Constants ¶
const ( DefaultMaxNodes = 500_000 DefaultMaxEdges = 2_000_000 HardMaxNodes = 2_000_000 HardMaxEdges = 10_000_000 DefaultMaxPathBytes = 4_096 DefaultMaxIdentifierBytes = 16_384 )
Variables ¶
var ErrInvalidArtifact = errors.New("invalid graph artifact")
var ErrUnsupportedVersion = errors.New("unsupported graph artifact version")
Functions ¶
func IdentityV2 ¶
IdentityV2 scopes original identity and occurrence by public repository and producer. A repeated qualified name or source ID never collapses declarations.
func ParseV2 ¶
ParseV2 is deliberately separate from the v1 storage/publication reader. No protobuf objects or extension JSON trees are allocated before wire bounds.
func SourceOffset ¶
SourceOffset resolves a zero-based UTF-16 position against exact UTF-8 source. It rejects columns inside a surrogate pair, beyond a line, and line-only data. CR is retained before LF, matching both CodeGraph producer implementations.
Types ¶
type Artifact ¶
type Artifact struct {
SchemaVersion uint32
Analyzer Analyzer
RepositoryID int64
Commit string
ContentHash []byte
Nodes []Node
Edges []Edge
}
func FromSCIP ¶
func FromSCIP(repository SCIPRepository, occurrences []scipgraph.Occurrence, relationships []scipgraph.Relationship) (Artifact, error)
type Relationship ¶
Relationship is the common wire, API-name and display contract. Every relation is directed source -> target; Incoming labels describe the reverse view.
func ParseRelationship ¶
func ParseRelationship(name string) (Relationship, bool)
ParseRelationship validates an API or producer name without aliases.
func RelationshipFromWire ¶
func RelationshipFromWire(kind graphv2.EdgeKind) (Relationship, bool)
RelationshipFromWire checks the full enum width before narrowing.
func Relationships ¶
func Relationships() []Relationship
Relationships returns a copy so callers cannot mutate the validation registry.
func (Relationship) WireKind ¶
func (r Relationship) WireKind() graphv2.EdgeKind