rename to registry
This commit is contained in:
parent
8cdc0939bb
commit
7827731423
@ -1,7 +0,0 @@
|
|||||||
package config
|
|
||||||
|
|
||||||
import "os"
|
|
||||||
|
|
||||||
func Endpoint() string {
|
|
||||||
return os.Getenv("ETCD_ENDPOINTS")
|
|
||||||
}
|
|
||||||
18
registry/etcd.go
Normal file
18
registry/etcd.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/gogf/gf/contrib/registry/etcd/v2"
|
||||||
|
"github.com/gogf/gf/contrib/rpc/grpcx/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Endpoint() string {
|
||||||
|
return os.Getenv("ETCD_ENDPOINTS")
|
||||||
|
}
|
||||||
|
|
||||||
|
func Etcd() {
|
||||||
|
if Endpoint() != "" {
|
||||||
|
grpcx.Resolver.Register(etcd.New(Endpoint()))
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user