Debian Codegraph @

nonclobbering/experimental/klauspost_snappy/klauspost_snappy.go

raw
1 // Copyright 2023 Mostyn Bramley-Moore.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Package github.com/mostynb/go-grpc-compression/nonclobbering/klauspost_snappy
16 // is a wrapper for using github.com/klauspost/compress/s2 in snappy
17 // compatibility mode with gRPC. It might be more efficient than
18 // github.com/mostynb/go-grpc-compression/snappy and
19 // github.com/mostynb/go-grpc-compression/nonclobbering/snappy
20 // packages which make use of github.com/golang/snappy.
21 //
22 // Note that this is registered under the name "snappy" with gRPC, so only
23 // one of these packages should be used at a time.
24 //
25 // If you import this package, it will only register itself as the encoder
26 // for the "snappy" compressor if no other compressors have already been
27 // registered with that name.
28 //
29 // If you do want to override previously registered "snappy" compressors,
30 // then you should instead import
31 // github.com/mostynb/go-grpc-compression/klauspost_snappy
32 package klauspost_snappy
33
34 import (
35 internalsnappy "github.com/mostynb/go-grpc-compression/internal/klauspost_snappy"
36 )
37
38 const Name = internalsnappy.Name
39
40 func init() {
41 clobbering := false
42 internalsnappy.PretendInit(clobbering)
43 }