removed dead code
This commit is contained in:
parent
e6537752d3
commit
5bd48aa9ac
@ -259,49 +259,3 @@ func (b *GenericBirdwatcher) NeighborsStatus(ctx context.Context) (
|
||||
}
|
||||
return response, nil // dereference for now
|
||||
}
|
||||
|
||||
// LookupPrefix makes a routes lookup
|
||||
func (b *GenericBirdwatcher) LookupPrefix(
|
||||
ctx context.Context,
|
||||
prefix string,
|
||||
) (*api.RoutesLookupResponse, error) {
|
||||
// Get RS info
|
||||
rs := &api.RouteServer{
|
||||
ID: b.config.ID,
|
||||
Name: b.config.Name,
|
||||
}
|
||||
|
||||
// Query prefix on RS
|
||||
bird, err := b.client.GetJSON(ctx, "/routes/prefix?prefix="+prefix)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Parse API status
|
||||
apiStatus, err := parseAPIStatus(bird, b.config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Parse routes
|
||||
routes, _ := parseRoutes(bird, b.config, true)
|
||||
|
||||
// Add corresponding neighbor and source rs to result
|
||||
results := api.LookupRoutes{}
|
||||
for _, src := range routes {
|
||||
route := &api.LookupRoute{
|
||||
RouteServer: rs,
|
||||
Route: src,
|
||||
}
|
||||
results = append(results, route)
|
||||
}
|
||||
|
||||
// Make result
|
||||
response := &api.RoutesLookupResponse{
|
||||
Response: api.Response{
|
||||
Meta: apiStatus,
|
||||
},
|
||||
Routes: results,
|
||||
}
|
||||
return response, nil
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
"github.com/alice-lg/alice-lg/pkg/sources"
|
||||
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"time"
|
||||
@ -319,14 +318,6 @@ func (gobgp *GoBGP) RoutesNotExported(
|
||||
return &routes, nil
|
||||
}
|
||||
|
||||
// LookupPrefix searches for a prefix
|
||||
func (gobgp *GoBGP) LookupPrefix(
|
||||
ctx context.Context,
|
||||
prefix string,
|
||||
) (*api.RoutesLookupResponse, error) {
|
||||
return nil, fmt.Errorf("not implemented: LookupPrefix")
|
||||
}
|
||||
|
||||
// AllRoutes returns a routes dump (filtered, received),
|
||||
// which is used to learn all prefixes to build
|
||||
// up a local store for searching.
|
||||
|
Loading…
x
Reference in New Issue
Block a user