Remove unused symbols (#2287)
This commit is contained in:
25
balancer.go
25
balancer.go
@ -19,7 +19,6 @@
|
|||||||
package grpc
|
package grpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
@ -118,26 +117,6 @@ type Balancer interface {
|
|||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
// downErr implements net.Error. It is constructed by gRPC internals and passed to the down
|
|
||||||
// call of Balancer.
|
|
||||||
type downErr struct {
|
|
||||||
timeout bool
|
|
||||||
temporary bool
|
|
||||||
desc string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e downErr) Error() string { return e.desc }
|
|
||||||
func (e downErr) Timeout() bool { return e.timeout }
|
|
||||||
func (e downErr) Temporary() bool { return e.temporary }
|
|
||||||
|
|
||||||
func downErrorf(timeout, temporary bool, format string, a ...interface{}) downErr {
|
|
||||||
return downErr{
|
|
||||||
timeout: timeout,
|
|
||||||
temporary: temporary,
|
|
||||||
desc: fmt.Sprintf(format, a...),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// RoundRobin returns a Balancer that selects addresses round-robin. It uses r to watch
|
// RoundRobin returns a Balancer that selects addresses round-robin. It uses r to watch
|
||||||
// the name resolution updates and updates the addresses available correspondingly.
|
// the name resolution updates and updates the addresses available correspondingly.
|
||||||
//
|
//
|
||||||
@ -410,7 +389,3 @@ func (rr *roundRobin) Close() error {
|
|||||||
type pickFirst struct {
|
type pickFirst struct {
|
||||||
*roundRobin
|
*roundRobin
|
||||||
}
|
}
|
||||||
|
|
||||||
func pickFirstBalancerV1(r naming.Resolver) Balancer {
|
|
||||||
return &pickFirst{&roundRobin{r: r}}
|
|
||||||
}
|
|
||||||
|
@ -39,6 +39,10 @@ import (
|
|||||||
_ "google.golang.org/grpc/resolver/passthrough"
|
_ "google.golang.org/grpc/resolver/passthrough"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func pickFirstBalancerV1(r naming.Resolver) Balancer {
|
||||||
|
return &pickFirst{&roundRobin{r: r}}
|
||||||
|
}
|
||||||
|
|
||||||
type testWatcher struct {
|
type testWatcher struct {
|
||||||
// the channel to receives name resolution updates
|
// the channel to receives name resolution updates
|
||||||
update chan *naming.Update
|
update chan *naming.Update
|
||||||
|
@ -47,7 +47,7 @@ func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
|
|||||||
|
|
||||||
// RegisterChannelzServiceToServer registers the channelz service to the given server.
|
// RegisterChannelzServiceToServer registers the channelz service to the given server.
|
||||||
func RegisterChannelzServiceToServer(s *grpc.Server) {
|
func RegisterChannelzServiceToServer(s *grpc.Server) {
|
||||||
channelzgrpc.RegisterChannelzServer(s, &serverImpl{})
|
channelzgrpc.RegisterChannelzServer(s, newCZServer())
|
||||||
}
|
}
|
||||||
|
|
||||||
func newCZServer() channelzgrpc.ChannelzServer {
|
func newCZServer() channelzgrpc.ChannelzServer {
|
||||||
|
@ -65,8 +65,6 @@ var (
|
|||||||
errConnDrain = errors.New("grpc: the connection is drained")
|
errConnDrain = errors.New("grpc: the connection is drained")
|
||||||
// errConnClosing indicates that the connection is closing.
|
// errConnClosing indicates that the connection is closing.
|
||||||
errConnClosing = errors.New("grpc: the connection is closing")
|
errConnClosing = errors.New("grpc: the connection is closing")
|
||||||
// errConnUnavailable indicates that the connection is unavailable.
|
|
||||||
errConnUnavailable = errors.New("grpc: the connection is unavailable")
|
|
||||||
// errBalancerClosed indicates that the balancer is closed.
|
// errBalancerClosed indicates that the balancer is closed.
|
||||||
errBalancerClosed = errors.New("grpc: balancer is closed")
|
errBalancerClosed = errors.New("grpc: balancer is closed")
|
||||||
// We use an accessor so that minConnectTimeout can be
|
// We use an accessor so that minConnectTimeout can be
|
||||||
@ -89,8 +87,6 @@ var (
|
|||||||
// errCredentialsConflict indicates that grpc.WithTransportCredentials()
|
// errCredentialsConflict indicates that grpc.WithTransportCredentials()
|
||||||
// and grpc.WithInsecure() are both called for a connection.
|
// and grpc.WithInsecure() are both called for a connection.
|
||||||
errCredentialsConflict = errors.New("grpc: transport credentials are set for an insecure connection (grpc.WithTransportCredentials() and grpc.WithInsecure() are both called)")
|
errCredentialsConflict = errors.New("grpc: transport credentials are set for an insecure connection (grpc.WithTransportCredentials() and grpc.WithInsecure() are both called)")
|
||||||
// errNetworkIO indicates that the connection is down due to some network I/O error.
|
|
||||||
errNetworkIO = errors.New("grpc: failed with network I/O error")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -856,14 +852,6 @@ func (ac *addrConn) printf(format string, a ...interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// errorf records an error in ac's event log, unless ac has been closed.
|
|
||||||
// REQUIRES ac.mu is held.
|
|
||||||
func (ac *addrConn) errorf(format string, a ...interface{}) {
|
|
||||||
if ac.events != nil {
|
|
||||||
ac.events.Errorf(format, a...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// resetTransport recreates a transport to the address for ac. The old
|
// resetTransport recreates a transport to the address for ac. The old
|
||||||
// transport will close itself on error or when the clientconn is closed.
|
// transport will close itself on error or when the clientconn is closed.
|
||||||
// The created transport must receive initial settings frame from the server.
|
// The created transport must receive initial settings frame from the server.
|
||||||
|
@ -29,7 +29,6 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"google.golang.org/grpc/peer"
|
"google.golang.org/grpc/peer"
|
||||||
@ -41,7 +40,6 @@ const (
|
|||||||
windowsCheckCommandArgs = "Get-WmiObject -Class Win32_BIOS"
|
windowsCheckCommandArgs = "Get-WmiObject -Class Win32_BIOS"
|
||||||
powershellOutputFilter = "Manufacturer"
|
powershellOutputFilter = "Manufacturer"
|
||||||
windowsManufacturerRegex = ":(.*)"
|
windowsManufacturerRegex = ":(.*)"
|
||||||
windowsCheckTimeout = 30 * time.Second
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type platformError string
|
type platformError string
|
||||||
|
@ -104,7 +104,6 @@ type headerFrame struct {
|
|||||||
|
|
||||||
type cleanupStream struct {
|
type cleanupStream struct {
|
||||||
streamID uint32
|
streamID uint32
|
||||||
idPtr *uint32
|
|
||||||
rst bool
|
rst bool
|
||||||
rstCode http2.ErrCode
|
rstCode http2.ErrCode
|
||||||
onWrite func()
|
onWrite func()
|
||||||
@ -138,9 +137,6 @@ type outgoingSettings struct {
|
|||||||
ss []http2.Setting
|
ss []http2.Setting
|
||||||
}
|
}
|
||||||
|
|
||||||
type settingsAck struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
type incomingGoAway struct {
|
type incomingGoAway struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,6 @@ func newTestHandlerResponseWriter() http.ResponseWriter {
|
|||||||
type handleStreamTest struct {
|
type handleStreamTest struct {
|
||||||
t *testing.T
|
t *testing.T
|
||||||
bodyw *io.PipeWriter
|
bodyw *io.PipeWriter
|
||||||
req *http.Request
|
|
||||||
rw testHandlerResponseWriter
|
rw testHandlerResponseWriter
|
||||||
ht *serverHandlerTransport
|
ht *serverHandlerTransport
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,3 @@ func errorf(format string, args ...interface{}) {
|
|||||||
grpclog.Errorf(format, args...)
|
grpclog.Errorf(format, args...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func fatalf(format string, args ...interface{}) {
|
|
||||||
if grpclog.V(logLevel) {
|
|
||||||
grpclog.Fatalf(format, args...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -176,7 +176,6 @@ type Stream struct {
|
|||||||
buf *recvBuffer
|
buf *recvBuffer
|
||||||
trReader io.Reader
|
trReader io.Reader
|
||||||
fc *inFlow
|
fc *inFlow
|
||||||
recvQuota uint32
|
|
||||||
wq *writeQuota
|
wq *writeQuota
|
||||||
|
|
||||||
// Callback to state application's intentions to read data. This
|
// Callback to state application's intentions to read data. This
|
||||||
|
@ -1747,13 +1747,6 @@ func TestContextErr(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func max(a, b int32) int32 {
|
|
||||||
if a > b {
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
|
|
||||||
type windowSizeConfig struct {
|
type windowSizeConfig struct {
|
||||||
serverStream int32
|
serverStream int32
|
||||||
serverConn int32
|
serverConn int32
|
||||||
|
@ -30,10 +30,6 @@ import (
|
|||||||
testpb "google.golang.org/grpc/interop/grpc_testing"
|
testpb "google.golang.org/grpc/interop/grpc_testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
value = "test_value"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
hsAddr = flag.String("alts_handshaker_service_address", "", "ALTS handshaker gRPC service address")
|
hsAddr = flag.String("alts_handshaker_service_address", "", "ALTS handshaker gRPC service address")
|
||||||
serverAddr = flag.String("server_address", ":8080", "The port on which the server is listening")
|
serverAddr = flag.String("server_address", ":8080", "The port on which the server is listening")
|
||||||
|
@ -156,13 +156,11 @@ type callInfo struct {
|
|||||||
compressorType string
|
compressorType string
|
||||||
failFast bool
|
failFast bool
|
||||||
stream *clientStream
|
stream *clientStream
|
||||||
traceInfo traceInfo // in trace.go
|
|
||||||
maxReceiveMessageSize *int
|
maxReceiveMessageSize *int
|
||||||
maxSendMessageSize *int
|
maxSendMessageSize *int
|
||||||
creds credentials.PerRPCCredentials
|
creds credentials.PerRPCCredentials
|
||||||
contentSubtype string
|
contentSubtype string
|
||||||
codec baseCodec
|
codec baseCodec
|
||||||
disableRetry bool
|
|
||||||
maxRetryRPCBufferSize int
|
maxRetryRPCBufferSize int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ const (
|
|||||||
inTrailer
|
inTrailer
|
||||||
outPayload
|
outPayload
|
||||||
outHeader
|
outHeader
|
||||||
outTrailer
|
// TODO: test outTrailer ?
|
||||||
connbegin
|
connbegin
|
||||||
connend
|
connend
|
||||||
)
|
)
|
||||||
|
@ -3059,10 +3059,6 @@ func testSetAndSendHeaderStreamingRPC(t *testing.T, e env) {
|
|||||||
defer te.tearDown()
|
defer te.tearDown()
|
||||||
tc := testpb.NewTestServiceClient(te.clientConn())
|
tc := testpb.NewTestServiceClient(te.clientConn())
|
||||||
|
|
||||||
const (
|
|
||||||
argSize = 1
|
|
||||||
respSize = 1
|
|
||||||
)
|
|
||||||
ctx := metadata.NewOutgoingContext(context.Background(), testMetadata)
|
ctx := metadata.NewOutgoingContext(context.Background(), testMetadata)
|
||||||
stream, err := tc.FullDuplexCall(ctx)
|
stream, err := tc.FullDuplexCall(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -4659,9 +4655,7 @@ func TestCredsHandshakeAuthority(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type clientFailCreds struct {
|
type clientFailCreds struct{}
|
||||||
got string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *clientFailCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {
|
func (c *clientFailCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {
|
||||||
return rawConn, nil, nil
|
return rawConn, nil, nil
|
||||||
|
Reference in New Issue
Block a user