Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Mar 14, 2024
1 parent 29d241c commit 2ae1bec
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions go-client/idl/base/host_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ package base

import (
"fmt"

"github.com/apache/thrift/lib/go/thrift"
)

type HostPortType int
type HostPortType int32

const (
HOST_TYPE_INVALID HostPortType = 0 // itoa
HOST_TYPE_IPV4 = 1
HOST_TYPE_GROUP = 2
HOST_TYPE_INVALID HostPortType = iota
HOST_TYPE_IPV4
HOST_TYPE_GROUP
)

type HostPort struct {
Expand Down Expand Up @@ -83,13 +84,6 @@ func (r *HostPort) Write(oprot thrift.TProtocol) error {
return nil
}

func (r *HostPort) String() string {
if r == nil {
return "<nil>"
}
return fmt.Sprintf("HostPort(%s:%d)", r.GetHost(), r.GetPort())
}

func (r *HostPort) GetHost() string {
return r.host
}
Expand All @@ -98,6 +92,13 @@ func (r *HostPort) GetPort() uint16 {
return r.port
}

func (r *HostPort) String() string {
if r == nil {
return "<nil>"
}
return fmt.Sprintf("HostPort(%s:%d)", r.host, r.port)
}

func (r *HostPort) GetHostPort() string {
return fmt.Sprintf("%s:%d", r.GetHost(), r.GetPort())
return fmt.Sprintf("%s:%d", r.host, r.port)
}

0 comments on commit 2ae1bec

Please sign in to comment.