util.go 394 B

12345678910111213141516
  1. package resolver
  2. import (
  3. "flag"
  4. "fmt"
  5. )
  6. // RegisterTarget will register grpc discovery mock address flag
  7. func RegisterTarget(target *string, discoveryID string) {
  8. flag.CommandLine.StringVar(
  9. target,
  10. fmt.Sprintf("grpc.%s", discoveryID),
  11. fmt.Sprintf("discovery://default/%s", discoveryID),
  12. fmt.Sprintf("App's grpc target.\n example: -grpc.%s=\"127.0.0.1:9090\"", discoveryID),
  13. )
  14. }