codegraph_go/
lib.rs

1//! # codegraph-go
2//!
3//! Go parser for CodeGraph - extracts code entities and relationships from Go source files.
4//!
5//! ## Features
6//!
7//! - Parse Go source files
8//! - Extract functions, structs, interfaces, and packages
9//! - Track relationships (calls, imports, interface implementations)
10//! - Full integration with codegraph-parser-api
11//!
12//! ## Quick Start
13//!
14//! ```rust,no_run
15//! use codegraph_go::GoParser;
16//! use codegraph_parser_api::CodeParser;
17//! use codegraph::CodeGraph;
18//! use std::path::Path;
19//!
20//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
21//! let mut graph = CodeGraph::in_memory()?;
22//! let parser = GoParser::new();
23//!
24//! let file_info = parser.parse_file(Path::new("main.go"), &mut graph)?;
25//! println!("Parsed {} functions", file_info.functions.len());
26//! # Ok(())
27//! # }
28//! ```
29
30mod extractor;
31mod mapper;
32mod parser_impl;
33mod visitor;
34
35// Re-export parser-api types for convenience
36pub use codegraph_parser_api::{
37    CodeParser, FileInfo, ParserConfig, ParserError, ParserMetrics, ProjectInfo,
38};
39
40// Export the Go parser implementation
41pub use parser_impl::GoParser;