Skip to content

Commit

Permalink
protocol: implement protocol.Body for few reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Aug 6, 2018
1 parent 067b4d2 commit edb1a73
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
10 changes: 9 additions & 1 deletion protocol/controlled_shutdown_request.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package protocol

type ControlledShutdownRequest struct {
Version int16
APIVersion int16
}

func (r *ControlledShutdownRequest) Encode(e PacketEncoder) (err error) {
Expand All @@ -11,3 +11,11 @@ func (r *ControlledShutdownRequest) Encode(e PacketEncoder) (err error) {
func (r *ControlledShutdownRequest) Decode(d PacketDecoder, version int16) (err error) {
return nil
}

func (r *ControlledShutdownRequest) Key() int16 {
return ControlledShutdownKey
}

func (r ControlledShutdownRequest) Version() int16 {
return r.Versoin
}
12 changes: 11 additions & 1 deletion protocol/sasl_handshake_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package protocol

type SaslHandshakeRequest struct{}
type SaslHandshakeRequest struct {
APIVersion int16
}

func (r *SaslHandshakeRequest) Encode(e PacketEncoder) (err error) {
return nil
Expand All @@ -9,3 +11,11 @@ func (r *SaslHandshakeRequest) Encode(e PacketEncoder) (err error) {
func (r *SaslHandshakeRequest) Decode(d PacketDecoder, version int16) (err error) {
return nil
}

func (r *SaslHandshakeRequest) Key() int16 {
return SaslHandshakeKey
}

func (r *SaslHandshakeRequest) Version() int16 {
return r.APIVersion
}
9 changes: 9 additions & 0 deletions protocol/update_metadata_request.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package protocol

type UpdateMetadataRequest struct {
APIVersion int16
}

func (r *UpdateMetadataRequest) Encode(e PacketEncoder) (err error) {
Expand All @@ -10,3 +11,11 @@ func (r *UpdateMetadataRequest) Encode(e PacketEncoder) (err error) {
func (r *UpdateMetadataRequest) Decode(d PacketDecoder, version int16) (err error) {
return nil
}

func (r *UpdateMetadataRequest) Key() int16 {
return UpdateMetadataKey
}

func (r *UpdateMetadataRequest) Version() int16 {
return r.APIVersion
}

0 comments on commit edb1a73

Please sign in to comment.