Move ReflectFunctionName to sutil, no more internal/ in plugins

main
René Jochum 1 year ago
parent 34fbffdc1e
commit d9aedfc5c2
Signed by: jochum
GPG Key ID: F7D906F5E51E8E5E

@ -3,6 +3,7 @@ package util
import (
"go-micro.dev/v4"
"go-micro.dev/v4/registry"
"jochum.dev/jo-micro/auth2/shared/sutil"
)
type ServiceListResult map[*registry.Service][]*registry.Endpoint
@ -59,7 +60,7 @@ func FindByEndpoint(service micro.Service, endpoint interface{}) ([]*registry.Se
return []*registry.Service{}, err
}
strEndpoint := ReflectFunctionName(endpoint)
strEndpoint := sutil.ReflectFunctionName(endpoint)
result := []*registry.Service{}
for s, eps := range services {
for _, ep := range eps {

@ -2,7 +2,7 @@ package endpointroles
import (
"jochum.dev/jo-micro/auth2"
"jochum.dev/jo-micro/auth2/internal/util"
"jochum.dev/jo-micro/auth2/shared/sutil"
)
// Add this on every Server that exposes RouterClientService
@ -21,7 +21,7 @@ type RuleOption func(e *Rule)
func Endpoint(n interface{}) RuleOption {
return func(e *Rule) {
e.Endpoint = util.ReflectFunctionName(n)
e.Endpoint = sutil.ReflectFunctionName(n)
}
}

@ -1,4 +1,4 @@
package util
package sutil
import (
"reflect"
Loading…
Cancel
Save