diff --git a/glide.yaml b/glide.yaml index ad445565..c0d65293 100644 --- a/glide.yaml +++ b/glide.yaml @@ -21,7 +21,6 @@ import: - package: github.com/abcum/rixxdb - package: github.com/asaskevich/govalidator version: ^8.0.0 -- package: github.com/cznic/zappy - package: github.com/dgrijalva/jwt-go version: ^3.1.0 - package: github.com/elithrar/simple-scrypt diff --git a/util/snap/snap.go b/util/snap/snap.go deleted file mode 100644 index 6dcf36fd..00000000 --- a/util/snap/snap.go +++ /dev/null @@ -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) - -} diff --git a/util/snap/snap_test.go b/util/snap/snap_test.go deleted file mode 100644 index 1d9af83f..00000000 --- a/util/snap/snap_test.go +++ /dev/null @@ -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) - }) - }) - -}