From 86d0dd5399b43bce5d06ee4d5f1742236d957a48 Mon Sep 17 00:00:00 2001 From: Stefan Martinov Date: Mon, 20 Jan 2025 12:38:34 +0100 Subject: [PATCH] chore: add utility functions for compressors --- client.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client.go b/client.go index aa4a44c..44bf018 100644 --- a/client.go +++ b/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