Remove unused snappy compression package
This commit is contained in:
parent
0dc9ad339c
commit
6c3ae600f8
3 changed files with 0 additions and 97 deletions
|
@ -21,7 +21,6 @@ import:
|
||||||
- package: github.com/abcum/rixxdb
|
- package: github.com/abcum/rixxdb
|
||||||
- package: github.com/asaskevich/govalidator
|
- package: github.com/asaskevich/govalidator
|
||||||
version: ^8.0.0
|
version: ^8.0.0
|
||||||
- package: github.com/cznic/zappy
|
|
||||||
- package: github.com/dgrijalva/jwt-go
|
- package: github.com/dgrijalva/jwt-go
|
||||||
version: ^3.1.0
|
version: ^3.1.0
|
||||||
- package: github.com/elithrar/simple-scrypt
|
- package: github.com/elithrar/simple-scrypt
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
// Copyright © 2016 Abcum Ltd
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package snap
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/cznic/zappy"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Encode(src []byte) (dst []byte, err error) {
|
|
||||||
|
|
||||||
if len(src) == 0 {
|
|
||||||
return src, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return zappy.Encode(nil, src)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func Decode(src []byte) (dst []byte, err error) {
|
|
||||||
|
|
||||||
if len(src) == 0 {
|
|
||||||
return src, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return zappy.Decode(nil, src)
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
// Copyright © 2016 Abcum Ltd
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package snap
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
. "github.com/smartystreets/goconvey/convey"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestEmpty(t *testing.T) {
|
|
||||||
|
|
||||||
dec := []byte("")
|
|
||||||
enc := []byte{}
|
|
||||||
|
|
||||||
Convey("Encoding should fail", t, func() {
|
|
||||||
Convey("Should encode", func() {
|
|
||||||
res, _ := Encode(dec)
|
|
||||||
So(res, ShouldResemble, enc)
|
|
||||||
})
|
|
||||||
Convey("Should decode", func() {
|
|
||||||
res, _ := Decode(enc)
|
|
||||||
So(res, ShouldResemble, dec)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEncoding(t *testing.T) {
|
|
||||||
|
|
||||||
dec := []byte("Hello World")
|
|
||||||
enc := []byte{11, 20, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100}
|
|
||||||
|
|
||||||
Convey("String should encode and decode", t, func() {
|
|
||||||
Convey("Should encode", func() {
|
|
||||||
res, _ := Encode(dec)
|
|
||||||
So(res, ShouldResemble, enc)
|
|
||||||
})
|
|
||||||
Convey("Should decode", func() {
|
|
||||||
res, _ := Decode(enc)
|
|
||||||
So(res, ShouldResemble, dec)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue