Skip to content

Commit 3ed10ac

Browse files
committed
correct capitalization
1 parent 1e39e03 commit 3ed10ac

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

server/util/proto/proto.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var Bool = gproto.Bool
2020
type Message = gproto.Message
2121
type MarshalOptions = gproto.MarshalOptions
2222

23-
type VtprotoMessage interface {
23+
type VTProtoMessage interface {
2424
MarshalVT() ([]byte, error)
2525
UnmarshalVT([]byte) error
2626
CloneMessageVT() Message
@@ -31,15 +31,15 @@ type VtprotoMessage interface {
3131
}
3232

3333
func Marshal(v Message) ([]byte, error) {
34-
vt, ok := v.(VtprotoMessage)
34+
vt, ok := v.(VTProtoMessage)
3535
if ok {
3636
return vt.MarshalVT()
3737
}
3838
return MarshalOld(v)
3939
}
4040

4141
func Unmarshal(b []byte, v Message) error {
42-
vt, ok := v.(VtprotoMessage)
42+
vt, ok := v.(VTProtoMessage)
4343
if ok {
4444
return vt.UnmarshalVT(b)
4545
}
@@ -48,7 +48,7 @@ func Unmarshal(b []byte, v Message) error {
4848
}
4949

5050
func Clone(v Message) Message {
51-
vt, ok := v.(VtprotoMessage)
51+
vt, ok := v.(VTProtoMessage)
5252
if ok {
5353
return vt.CloneMessageVT()
5454
}

server/util/vtprotocodec/vtprotocodec.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ import (
1111

1212
const Name = "proto"
1313

14-
// vtprotoCodecV2 implements encoding.CodecV2 and uses vtproto and default buffer pool
14+
// VTProtoCodecV2 implements encoding.CodecV2 and uses vtproto and default buffer pool
1515
// to encode/decode proto messages. The implementation is heavily inspired by
1616
// https://github.com/planetscale/vtprotobuf/pull/138
1717
// and https://github.com/vitessio/vitess/pull/16790.
18-
type vtprotoCodecV2 struct {
18+
type VTProtoCodecV2 struct {
1919
fallback encoding.CodecV2
2020
}
2121

22-
func (vtprotoCodecV2) Name() string {
22+
func (VTProtoCodecV2) Name() string {
2323
return Name
2424
}
2525

26-
func (c *vtprotoCodecV2) Marshal(v any) (mem.BufferSlice, error) {
27-
m, ok := v.(proto.VtprotoMessage)
26+
func (c *VTProtoCodecV2) Marshal(v any) (mem.BufferSlice, error) {
27+
m, ok := v.(proto.VTProtoMessage)
2828
if !ok {
2929
return c.fallback.Marshal(v)
3030
}
@@ -47,8 +47,8 @@ func (c *vtprotoCodecV2) Marshal(v any) (mem.BufferSlice, error) {
4747
return mem.BufferSlice{mem.NewBuffer(buf, pool)}, nil
4848
}
4949

50-
func (c *vtprotoCodecV2) Unmarshal(data mem.BufferSlice, v any) error {
51-
m, ok := v.(proto.VtprotoMessage)
50+
func (c *VTProtoCodecV2) Unmarshal(data mem.BufferSlice, v any) error {
51+
m, ok := v.(proto.VTProtoMessage)
5252
if !ok {
5353
return c.fallback.Unmarshal(data, v)
5454
}
@@ -61,7 +61,7 @@ func (c *vtprotoCodecV2) Unmarshal(data mem.BufferSlice, v any) error {
6161
// RegisterCodec registers the vtprotoCodec to encode/decode proto messages with
6262
// all gRPC clients and servers.
6363
func Register() {
64-
encoding.RegisterCodecV2(&vtprotoCodecV2{
64+
encoding.RegisterCodecV2(&VTProtoCodecV2{
6565
fallback: encoding.GetCodecV2("proto"),
6666
})
6767
}

0 commit comments

Comments
 (0)