Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move proto codec to separate Go module #138

Merged
merged 3 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions encoding/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ var (
JSON = JSONcodec{}
// Gob is a GobCodec that encodes/decodes Go values to/from gob.
Gob = GobCodec{}
// PB is a PBcodec that encodes/decodes Go values to/from Protocol Buffers.
PB = PBcodec{}
)
2 changes: 0 additions & 2 deletions encoding/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module github.com/philippgille/gokv/encoding

go 1.18

require google.golang.org/protobuf v1.31.0
8 changes: 0 additions & 8 deletions encoding/go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
5 changes: 5 additions & 0 deletions encoding/proto/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/philippgille/gokv/encoding/proto

go 1.18

require google.golang.org/protobuf v1.31.0
8 changes: 8 additions & 0 deletions encoding/proto/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
9 changes: 8 additions & 1 deletion encoding/proto.go → encoding/proto/proto.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package encoding
package proto

import (
"errors"

"google.golang.org/protobuf/proto"
)

// Convenience variable for simpler usage in gokv store options.
//
// options := redis.Options{
// Encoding: proto.Codec,
// }
var Codec = PBcodec{}

// PBcodec encodes/decodes Go values to/from protocol buffers.
type PBcodec struct{}

Expand Down
Loading