Skip to content

Commit

Permalink
follow convension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hǎiliàng Wáng committed Sep 11, 2015
1 parent 28407fb commit 0da0a33
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 8 additions & 1 deletion proto/pre.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
package proto

type T interface{}
import (
"encoding"
)

type T interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
}
6 changes: 3 additions & 3 deletions proto/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ type RequestOrResponse struct {
}

type Request struct {
ApiKey int16
ApiVersion int16
APIKey int16
APIVersion int16
CorrelationID int32
ClientID string
RequestMessage RequestMessage
Expand Down Expand Up @@ -62,7 +62,7 @@ type PartitionMetadata struct {
PartitionID int32
Leader int32
Replicas int32
Isr int32
ISR int32
}

type ProduceRequest struct {
Expand Down
2 changes: 2 additions & 0 deletions spec/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func goName(s string) string {
return strings.TrimSuffix(s, "Id") + "ID"
}
s = strings.Replace(s, "Crc", "CRC", -1)
s = strings.Replace(s, "Api", "API", -1)
s = strings.Replace(s, "Isr", "ISR", -1)
return s
}

Expand Down
2 changes: 1 addition & 1 deletion spec/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func main() {
if len(os.Args) != 2 {
fmt.Println("go run gen.go (bnf | json | go)")
fmt.Println("gen (bnf | json | go)")
return
}
switch os.Args[1] {
Expand Down

0 comments on commit 0da0a33

Please sign in to comment.