Documentation
¶
Index ¶
- func NewJSONPlugin(logger *slog.Logger) model.ParserPlugin
- type JSONPlugin
- func (p *JSONPlugin) CanHandle(path string, info fs.FileInfo) bool
- func (p *JSONPlugin) Chunk(content string, path string, opts *model.CodeChunkingOptions) ([]model.CodeChunk, error)
- func (p *JSONPlugin) Extensions() []string
- func (p *JSONPlugin) ExtractMetadata(content string, path string) (model.FileMetadata, error)
- func (p *JSONPlugin) Name() string
- type JSONStructure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJSONPlugin ¶
func NewJSONPlugin(logger *slog.Logger) model.ParserPlugin
NewJSONPlugin creates a new JSON language plugin
Types ¶
type JSONPlugin ¶
type JSONPlugin struct {
// contains filtered or unexported fields
}
JSONPlugin implements language.Plugin for JSON files
func (*JSONPlugin) CanHandle ¶
func (p *JSONPlugin) CanHandle(path string, info fs.FileInfo) bool
CanHandle determines if this plugin can process the given file
func (*JSONPlugin) Chunk ¶
func (p *JSONPlugin) Chunk(content string, path string, opts *model.CodeChunkingOptions) ([]model.CodeChunk, error)
Chunk breaks JSON into semantic chunks based on structure
func (*JSONPlugin) Extensions ¶
func (p *JSONPlugin) Extensions() []string
Extensions returns file extensions for JSON
func (*JSONPlugin) ExtractMetadata ¶
func (p *JSONPlugin) ExtractMetadata(content string, path string) (model.FileMetadata, error)
ExtractMetadata extracts language-specific metadata from JSON content
func (*JSONPlugin) Name ¶
func (p *JSONPlugin) Name() string
Name returns "json" as the language name
type JSONStructure ¶
type JSONStructure struct {
Type string // object, array, primitive
Key string // for object properties
Value any // the actual JSON value
Children []JSONStructure
Path string // JSON path like "users[0].name"
LineStart int
LineEnd int
}
JSONStructure represents different types of JSON structures
Click to show internal directories.
Click to hide internal directories.