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 ¶
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]]
Click to show internal directories.
Click to hide internal directories.