MCPcopy Create free account
hub / github.com/RedisGraph/redisgraph-go / getLabel

Method getLabel

graph.go:196–214  ·  view source on GitHub ↗
(lblIdx int)

Source from the content-addressed store, hash-verified

194}
195
196func (g *Graph) getLabel(lblIdx int) string {
197 if lblIdx >= len(g.labels) {
198 // Missing label, refresh label mapping table.
199 g.mutex.Lock()
200
201 // Recheck now that we've got the lock.
202 if lblIdx >= len(g.labels) {
203 g.labels = g.Labels()
204 // Retry.
205 if lblIdx >= len(g.labels) {
206 // Error!
207 panic("Unknown label index.")
208 }
209 }
210 g.mutex.Unlock()
211 }
212
213 return g.labels[lblIdx]
214}
215
216func (g *Graph) getRelation(relIdx int) string {
217 if relIdx >= len(g.relationshipTypes) {

Callers 1

parseNodeMethod · 0.80

Calls 1

LabelsMethod · 0.95

Tested by

no test coverage detected