1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-16 02:47:03 +02:00
kratos/contrib/registry/etcd/service.go
Windfarer 0ec3ff0b46
refactor: move plugins to contrib dir (#1399)
* move to contrib dir


Co-authored-by: chenzhihui <zhihui_chen@foxmail.com>
2021-09-01 13:40:14 +08:00

21 lines
360 B
Go

package etcd
import (
"encoding/json"
"github.com/go-kratos/kratos/v2/registry"
)
func marshal(si *registry.ServiceInstance) (string, error) {
data, err := json.Marshal(si)
if err != nil {
return "", err
}
return string(data), nil
}
func unmarshal(data []byte) (si *registry.ServiceInstance, err error) {
err = json.Unmarshal(data, &si)
return
}