feat mysql
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"common/config"
|
||||
"context"
|
||||
"go.etcd.io/etcd/client/v3"
|
||||
"go.uber.org/zap"
|
||||
@@ -15,9 +16,9 @@ type Client struct {
|
||||
}
|
||||
|
||||
// Init 初始化
|
||||
func Init(endpoints []string) error {
|
||||
func Init(cfg *config.EtcdConfig) error {
|
||||
client, err := clientv3.New(clientv3.Config{
|
||||
Endpoints: endpoints,
|
||||
Endpoints: cfg.Endpoints,
|
||||
DialTimeout: 5 * time.Second,
|
||||
})
|
||||
instance = &Client{
|
||||
Reference in New Issue
Block a user