Skip to content

Commit

Permalink
Add convenience variable
Browse files Browse the repository at this point in the history
Like encoding.JSON and encoding.Gob, but here just Codec because we're in the proto package
and want to avoid stuttering.
  • Loading branch information
philippgille committed Nov 4, 2023
1 parent 474d02a commit 966fc3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions encoding/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import (
"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

0 comments on commit 966fc3a

Please # to comment.