mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
chore: add utility functions for compressors
This commit is contained in:
parent
eb669997f0
commit
86d0dd5399
12
client.go
12
client.go
@ -106,6 +106,18 @@ func WithCompressor(compressor Compressor) ClientOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithSnappyCompression() ClientOption {
|
||||
return WithCompressor(CompressorSnappy)
|
||||
}
|
||||
|
||||
func WithGZIPCompression() ClientOption {
|
||||
return WithCompressor(CompressorGZIP)
|
||||
}
|
||||
|
||||
func WithNoCompression() ClientOption {
|
||||
return WithCompressor(CompressorNone)
|
||||
}
|
||||
|
||||
// NewBufferedClient is the constructor that applies all functional options.
|
||||
func NewBufferedClient(opts ...ClientOption) *BufferedClient {
|
||||
// Set reasonable defaults here
|
||||
|
||||
Loading…
Reference in New Issue
Block a user