MCPcopy Index your code
hub / github.com/perkeep/perkeep / locationPredicate

Function locationPredicate

pkg/search/predicate.go:593–614  ·  view source on GitHub ↗
(ctx context.Context, rects []geocode.Rect)

Source from the content-addressed store, hash-verified

591}
592
593func locationPredicate(ctx context.Context, rects []geocode.Rect) (*Constraint, error) {
594 var c *Constraint
595 for i, rect := range rects {
596 loc := &LocationConstraint{
597 West: rect.SouthWest.Long,
598 East: rect.NorthEast.Long,
599 North: rect.NorthEast.Lat,
600 South: rect.SouthWest.Lat,
601 }
602 permLoc := &Constraint{
603 Permanode: &PermanodeConstraint{
604 Location: loc,
605 },
606 }
607 if i == 0 {
608 c = permLoc
609 } else {
610 c = orConst(c, permLoc)
611 }
612 }
613 return c, nil
614}
615
616func (l namedLocation) Predicate(ctx context.Context, args []string) (*Constraint, error) {
617 where := args[0]

Callers 2

PredicateMethod · 0.85
PredicateMethod · 0.85

Calls 1

orConstFunction · 0.85

Tested by

no test coverage detected