Skip to content

Commit

Permalink
UPDATED to open up the discover function
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanValentine committed Jan 10, 2020
1 parent 3987214 commit d8940e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ func (d *Discover) discover(signature string) (*types.Service, error) {
if err != nil {
return nil, err
}
return d.Discover(sig)
return d.Locator.Discover(sig)
}

func (d *Discover) Discover(addr string) (*types.Service, error) {
return d.discover(addr)
}

// Request makes synchronous call through the FunctionAdapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package main

import (
"github.com/peak-ai/ais-service-discovery-go/pkg/parser"
"log"

d "github.com/peak-ai/ais-service-discovery-go"
)

func main() {
discovery := d.NewDiscovery(d.WithAWSBackend())
signature, err := parser.ParseAddr("acme-prod.my-service->queue")
res, err := discovery.Discover(signature)
res, err := discovery.Discover("acme-latest.generator->queue")
if err != nil {
log.Panic(err)
}
Expand Down

0 comments on commit d8940e6

Please sign in to comment.