Skip to content

Commit

Permalink
encoding: fix mention of DecompressedSize in docstring (#6665)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars authored Sep 26, 2023
1 parent 09792b5 commit ee4b62c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const Identity = "identity"

// Compressor is used for compressing and decompressing when sending or
// receiving messages.
//
// If a Compressor implements `DecompressedSize(compressedBytes []byte) int`,
// gRPC will invoke it to determine the size of the buffer allocated for the
// result of decompression. A return value of -1 indicates unknown size.
type Compressor interface {
// Compress writes the data written to wc to w after compressing it. If an
// error occurs while initializing the compressor, that error is returned
Expand All @@ -51,15 +55,6 @@ type Compressor interface {
// coding header. The result must be static; the result cannot change
// between calls.
Name() string
// If a Compressor implements
// DecompressedSize(compressedBytes []byte) int, gRPC will call it
// to determine the size of the buffer allocated for the result of decompression.
// Return -1 to indicate unknown size.
//
// Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
}

var registeredCompressor = make(map[string]Compressor)
Expand Down

0 comments on commit ee4b62c

Please sign in to comment.