MCPcopy
hub / github.com/micro/go-micro / encode

Function encode

registry/consul/encoding.go:13–24  ·  view source on GitHub ↗
(buf []byte)

Source from the content-addressed store, hash-verified

11)
12
13func encode(buf []byte) string {
14 var b bytes.Buffer
15 defer b.Reset()
16
17 w := zlib.NewWriter(&b)
18 if _, err := w.Write(buf); err != nil {
19 return ""
20 }
21 w.Close()
22
23 return hex.EncodeToString(b.Bytes())
24}
25
26func decode(d string) []byte {
27 hr, err := hex.DecodeString(d)

Callers 4

encodeEndpointsFunction · 0.70
encodeMetadataFunction · 0.70
encodeVersionFunction · 0.70
TestEncodingEndpointsFunction · 0.70

Calls 4

WriteMethod · 0.95
ResetMethod · 0.65
CloseMethod · 0.65
BytesMethod · 0.65

Tested by 1

TestEncodingEndpointsFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…