index

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package index defines serializable data structures for representing the mapping of C/C++ header include paths to Bazel targets defining them. They serve as a protocol for exchanging data between an indexer and gazelle_cc.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyIndex

type DependencyIndex map[string][]label.Label

DependencyIndex maps C/C++ header include paths to the Bazel targets (more than one in case of ambiguity). Serializable to/from JSON.

func (DependencyIndex) MarshalJSON

func (index DependencyIndex) MarshalJSON() ([]byte, error)
Example
index := DependencyIndex{
	"header.h": {
		label.New("my_repo", "my_pkg", "my_target"),
	},
}
data, _ := json.Marshal(index)
fmt.Printf("%s", data)
Output:

{"header.h":["@my_repo//my_pkg:my_target"]}

func (*DependencyIndex) UnmarshalJSON

func (index *DependencyIndex) UnmarshalJSON(data []byte) error
Example
jsonData := []byte(`{"header.h":["@my_repo//my_pkg:my_target"]}`)
var index DependencyIndex
_ = json.Unmarshal(jsonData, &index)
fmt.Print(index)
Output:

map[header.h:[@my_repo//my_pkg:my_target]]

Jump to

Keyboard shortcuts

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