ais-service-discovery-go icon indicating copy to clipboard operation
ais-service-discovery-go copied to clipboard

Look into possible other solutions to the signature

Open EwanValentine opened this issue 4 years ago • 0 comments

A few users have suggested the namespace.service->instance signature type, isn't very 'Go'. This was ported over from a Javascript library (the wild west), so I maybe need to investigate a more Go friendly approach.

Possibly:

d := discover.NewDiscovery(
  discover.SetNamespace("default"),
)

srv := d.SetService("my-service")
res := srv.Request("instance")
...
res := srv.RequestWithOpts("instance", opts)

Or:

res := d.Request(&discover.Addr{
  Namespace: "default",
  Service: "my-service",
  Instance: "my-func"},
  req,
)

EwanValentine avatar Oct 28 '19 23:10 EwanValentine