You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
364 B
21 lines
364 B
3 years ago
|
package registry
|
||
|
|
||
|
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
|
||
|
}
|