From c06f1115801a32300c741e30dc07da6d9962e382 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 2 Oct 2016 11:36:14 +0100 Subject: [PATCH] Remove unused codec interface file --- util/pack/sql-all.go | 25 ------------------------ util/pack/sql-asc.go | 25 ------------------------ util/pack/sql-desc.go | 25 ------------------------ util/pack/sql-empty.go | 25 ------------------------ util/pack/sql-field.go | 44 ------------------------------------------ util/pack/sql-group.go | 44 ------------------------------------------ util/pack/sql-ident.go | 34 -------------------------------- util/pack/sql-null.go | 25 ------------------------ util/pack/sql-order.go | 44 ------------------------------------------ util/pack/sql-table.go | 34 -------------------------------- util/pack/sql-thing.go | 44 ------------------------------------------ util/pack/sql-void.go | 25 ------------------------ util/pack/time.go | 35 --------------------------------- 13 files changed, 429 deletions(-) delete mode 100644 util/pack/sql-all.go delete mode 100644 util/pack/sql-asc.go delete mode 100644 util/pack/sql-desc.go delete mode 100644 util/pack/sql-empty.go delete mode 100644 util/pack/sql-field.go delete mode 100644 util/pack/sql-group.go delete mode 100644 util/pack/sql-ident.go delete mode 100644 util/pack/sql-null.go delete mode 100644 util/pack/sql-order.go delete mode 100644 util/pack/sql-table.go delete mode 100644 util/pack/sql-thing.go delete mode 100644 util/pack/sql-void.go delete mode 100644 util/pack/time.go diff --git a/util/pack/sql-all.go b/util/pack/sql-all.go deleted file mode 100644 index e91d4425..00000000 --- a/util/pack/sql-all.go +++ /dev/null @@ -1,25 +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 pack - -type extSqlAll struct{} - -func (x extSqlAll) ReadExt(dst interface{}, src []byte) { - return -} - -func (x extSqlAll) WriteExt(src interface{}) (dst []byte) { - return []byte{0x00} -} diff --git a/util/pack/sql-asc.go b/util/pack/sql-asc.go deleted file mode 100644 index 600a23f3..00000000 --- a/util/pack/sql-asc.go +++ /dev/null @@ -1,25 +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 pack - -type extSqlAsc struct{} - -func (x extSqlAsc) ReadExt(dst interface{}, src []byte) { - return -} - -func (x extSqlAsc) WriteExt(src interface{}) (dst []byte) { - return []byte{0x00} -} diff --git a/util/pack/sql-desc.go b/util/pack/sql-desc.go deleted file mode 100644 index 50e23b6d..00000000 --- a/util/pack/sql-desc.go +++ /dev/null @@ -1,25 +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 pack - -type extSqlDesc struct{} - -func (x extSqlDesc) ReadExt(dst interface{}, src []byte) { - return -} - -func (x extSqlDesc) WriteExt(src interface{}) (dst []byte) { - return []byte{0x00} -} diff --git a/util/pack/sql-empty.go b/util/pack/sql-empty.go deleted file mode 100644 index 9d043d56..00000000 --- a/util/pack/sql-empty.go +++ /dev/null @@ -1,25 +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 pack - -type extSqlEmpty struct{} - -func (x extSqlEmpty) ReadExt(dst interface{}, src []byte) { - return -} - -func (x extSqlEmpty) WriteExt(src interface{}) (dst []byte) { - return []byte{0x00} -} diff --git a/util/pack/sql-field.go b/util/pack/sql-field.go deleted file mode 100644 index b00c0328..00000000 --- a/util/pack/sql-field.go +++ /dev/null @@ -1,44 +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 pack - -import ( - "bytes" - "encoding/gob" - - "github.com/abcum/surreal/sql" -) - -type extSqlField struct{} - -func (x extSqlField) ReadExt(dst interface{}, src []byte) { - buf := bytes.NewBuffer(src) - dec := gob.NewDecoder(buf) - dec.Decode(dst.(*sql.Field)) - return -} - -func (x extSqlField) WriteExt(src interface{}) (dst []byte) { - buf := bytes.NewBuffer(nil) - switch obj := src.(type) { - case sql.Field: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - case *sql.Field: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - } - return buf.Bytes() -} diff --git a/util/pack/sql-group.go b/util/pack/sql-group.go deleted file mode 100644 index 523b8adc..00000000 --- a/util/pack/sql-group.go +++ /dev/null @@ -1,44 +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 pack - -import ( - "bytes" - "encoding/gob" - - "github.com/abcum/surreal/sql" -) - -type extSqlGroup struct{} - -func (x extSqlGroup) ReadExt(dst interface{}, src []byte) { - buf := bytes.NewBuffer(src) - dec := gob.NewDecoder(buf) - dec.Decode(dst.(*sql.Group)) - return -} - -func (x extSqlGroup) WriteExt(src interface{}) (dst []byte) { - buf := bytes.NewBuffer(nil) - switch obj := src.(type) { - case sql.Group: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - case *sql.Group: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - } - return buf.Bytes() -} diff --git a/util/pack/sql-ident.go b/util/pack/sql-ident.go deleted file mode 100644 index e532ea3a..00000000 --- a/util/pack/sql-ident.go +++ /dev/null @@ -1,34 +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 pack - -import "github.com/abcum/surreal/sql" - -type extSqlIdent struct{} - -func (x extSqlIdent) ReadExt(dst interface{}, src []byte) { - dst.(*sql.Ident).ID = string(src) - return -} - -func (x extSqlIdent) WriteExt(src interface{}) (dst []byte) { - switch obj := src.(type) { - case sql.Ident: - dst = []byte(obj.ID) - case *sql.Ident: - dst = []byte(obj.ID) - } - return -} diff --git a/util/pack/sql-null.go b/util/pack/sql-null.go deleted file mode 100644 index c4da7f91..00000000 --- a/util/pack/sql-null.go +++ /dev/null @@ -1,25 +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 pack - -type extSqlNull struct{} - -func (x extSqlNull) ReadExt(dst interface{}, src []byte) { - return -} - -func (x extSqlNull) WriteExt(src interface{}) (dst []byte) { - return []byte{0x00} -} diff --git a/util/pack/sql-order.go b/util/pack/sql-order.go deleted file mode 100644 index 088e280a..00000000 --- a/util/pack/sql-order.go +++ /dev/null @@ -1,44 +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 pack - -import ( - "bytes" - "encoding/gob" - - "github.com/abcum/surreal/sql" -) - -type extSqlOrder struct{} - -func (x extSqlOrder) ReadExt(dst interface{}, src []byte) { - buf := bytes.NewBuffer(src) - dec := gob.NewDecoder(buf) - dec.Decode(dst.(*sql.Order)) - return -} - -func (x extSqlOrder) WriteExt(src interface{}) (dst []byte) { - buf := bytes.NewBuffer(nil) - switch obj := src.(type) { - case sql.Order: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - case *sql.Order: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - } - return buf.Bytes() -} diff --git a/util/pack/sql-table.go b/util/pack/sql-table.go deleted file mode 100644 index 9c19d73e..00000000 --- a/util/pack/sql-table.go +++ /dev/null @@ -1,34 +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 pack - -import "github.com/abcum/surreal/sql" - -type extSqlTable struct{} - -func (x extSqlTable) ReadExt(dst interface{}, src []byte) { - dst.(*sql.Table).TB = string(src) - return -} - -func (x extSqlTable) WriteExt(src interface{}) (dst []byte) { - switch obj := src.(type) { - case sql.Table: - dst = []byte(obj.TB) - case *sql.Table: - dst = []byte(obj.TB) - } - return -} diff --git a/util/pack/sql-thing.go b/util/pack/sql-thing.go deleted file mode 100644 index 69d1c889..00000000 --- a/util/pack/sql-thing.go +++ /dev/null @@ -1,44 +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 pack - -import ( - "bytes" - "encoding/gob" - - "github.com/abcum/surreal/sql" -) - -type extSqlThing struct{} - -func (x extSqlThing) ReadExt(dst interface{}, src []byte) { - buf := bytes.NewBuffer(src) - dec := gob.NewDecoder(buf) - dec.Decode(dst.(*sql.Thing)) - return -} - -func (x extSqlThing) WriteExt(src interface{}) (dst []byte) { - buf := bytes.NewBuffer(nil) - switch obj := src.(type) { - case sql.Thing: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - case *sql.Thing: - enc := gob.NewEncoder(buf) - enc.Encode(obj) - } - return buf.Bytes() -} diff --git a/util/pack/sql-void.go b/util/pack/sql-void.go deleted file mode 100644 index 5322deda..00000000 --- a/util/pack/sql-void.go +++ /dev/null @@ -1,25 +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 pack - -type extSqlVoid struct{} - -func (x extSqlVoid) ReadExt(dst interface{}, src []byte) { - return -} - -func (x extSqlVoid) WriteExt(src interface{}) (dst []byte) { - return []byte{0x00} -} diff --git a/util/pack/time.go b/util/pack/time.go deleted file mode 100644 index e40dab3d..00000000 --- a/util/pack/time.go +++ /dev/null @@ -1,35 +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 pack - -import ( - "time" -) - -type extTime struct{} - -func (x extTime) ReadExt(dst interface{}, src []byte) { - dst.(*time.Time).UnmarshalBinary(src) -} - -func (x extTime) WriteExt(src interface{}) (dst []byte) { - switch obj := src.(type) { - case time.Time: - dst, _ = obj.MarshalBinary() - case *time.Time: - dst, _ = obj.MarshalBinary() - } - return -}