MCPcopy
hub / github.com/grpc/grpc-go / init

Function init

encoding/encoding.go:41–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39const Identity = "identity"
40
41func init() {
42 internal.RegisterCompressorForTesting = func(c Compressor) func() {
43 name := c.Name()
44 curCompressor, found := registeredCompressor[name]
45 RegisterCompressor(c)
46 return func() {
47 if found {
48 registeredCompressor[name] = curCompressor
49 return
50 }
51 delete(registeredCompressor, name)
52 grpcutil.RegisteredCompressorNames = slices.DeleteFunc(grpcutil.RegisteredCompressorNames, func(s string) bool {
53 return s == name
54 })
55 }
56 }
57}
58
59// Compressor is used for compressing and decompressing when sending or
60// receiving messages.

Callers

nothing calls this directly

Calls 2

RegisterCompressorFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected