Skip to content

Commit

Permalink
Use int16
Browse files Browse the repository at this point in the history
  • Loading branch information
Mongey committed Feb 19, 2019
1 parent 9186fc4 commit 2082771
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions acl_bindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Resource struct {
ResoucePatternType AclResourcePatternType
}

func (r *Resource) encode(pe packetEncoder, version int) error {
func (r *Resource) encode(pe packetEncoder, version int16) error {
pe.putInt8(int8(r.ResourceType))

if err := pe.putString(r.ResourceName); err != nil {
Expand Down Expand Up @@ -96,7 +96,7 @@ type ResourceAcls struct {
Acls []*Acl
}

func (r *ResourceAcls) encode(pe packetEncoder, version int) error {
func (r *ResourceAcls) encode(pe packetEncoder, version int16) error {
if err := r.Resource.encode(pe, version); err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions acl_create_request.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sarama

type CreateAclsRequest struct {
Version int
Version int16
AclCreations []*AclCreation
}

Expand All @@ -20,7 +20,7 @@ func (c *CreateAclsRequest) encode(pe packetEncoder) error {
}

func (c *CreateAclsRequest) decode(pd packetDecoder, version int16) (err error) {
c.Version = int(version)
c.Version = version
n, err := pd.getArrayLength()
if err != nil {
return err
Expand All @@ -43,7 +43,7 @@ func (d *CreateAclsRequest) key() int16 {
}

func (d *CreateAclsRequest) version() int16 {
return int16(d.Version)
return d.Version
}

func (d *CreateAclsRequest) requiredVersion() KafkaVersion {
Expand All @@ -60,7 +60,7 @@ type AclCreation struct {
Acl
}

func (a *AclCreation) encode(pe packetEncoder, version int) error {
func (a *AclCreation) encode(pe packetEncoder, version int16) error {
if err := a.Resource.encode(pe, version); err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions acl_delete_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sarama
import "time"

type DeleteAclsResponse struct {
Version int
Version int16
ThrottleTime time.Duration
FilterResponses []*FilterResponse
}
Expand Down Expand Up @@ -65,7 +65,7 @@ type FilterResponse struct {
MatchingAcls []*MatchingAcl
}

func (f *FilterResponse) encode(pe packetEncoder, version int) error {
func (f *FilterResponse) encode(pe packetEncoder, version int16) error {
pe.putInt16(int16(f.Err))
if err := pe.putNullableString(f.ErrMsg); err != nil {
return err
Expand Down Expand Up @@ -116,7 +116,7 @@ type MatchingAcl struct {
Acl
}

func (m *MatchingAcl) encode(pe packetEncoder, version int) error {
func (m *MatchingAcl) encode(pe packetEncoder, version int16) error {
pe.putInt16(int16(m.Err))
if err := pe.putNullableString(m.ErrMsg); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion acl_describe_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sarama
import "time"

type DescribeAclsResponse struct {
Version int
Version int16
ThrottleTime time.Duration
Err KError
ErrMsg *string
Expand Down

0 comments on commit 2082771

Please sign in to comment.