Remove unused symbols (#2287)

This commit is contained in:
dfawley
2018-09-05 12:29:02 -07:00
committed by GitHub
parent 90f728eaf7
commit 5fe10fccaf
14 changed files with 7 additions and 73 deletions

View File

@ -19,7 +19,6 @@
package grpc
import (
"fmt"
"net"
"sync"
@ -118,26 +117,6 @@ type Balancer interface {
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
// the name resolution updates and updates the addresses available correspondingly.
//
@ -410,7 +389,3 @@ func (rr *roundRobin) Close() error {
type pickFirst struct {
*roundRobin
}
func pickFirstBalancerV1(r naming.Resolver) Balancer {
return &pickFirst{&roundRobin{r: r}}
}

View File

@ -39,6 +39,10 @@ import (
_ "google.golang.org/grpc/resolver/passthrough"
)
func pickFirstBalancerV1(r naming.Resolver) Balancer {
return &pickFirst{&roundRobin{r: r}}
}
type testWatcher struct {
// the channel to receives name resolution updates
update chan *naming.Update

View File

@ -47,7 +47,7 @@ func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
// RegisterChannelzServiceToServer registers the channelz service to the given server.
func RegisterChannelzServiceToServer(s *grpc.Server) {
channelzgrpc.RegisterChannelzServer(s, &serverImpl{})
channelzgrpc.RegisterChannelzServer(s, newCZServer())
}
func newCZServer() channelzgrpc.ChannelzServer {

View File

@ -65,8 +65,6 @@ var (
errConnDrain = errors.New("grpc: the connection is drained")
// errConnClosing indicates that 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 = errors.New("grpc: balancer is closed")
// We use an accessor so that minConnectTimeout can be
@ -89,8 +87,6 @@ var (
// errCredentialsConflict indicates that grpc.WithTransportCredentials()
// 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)")
// 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 (
@ -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
// transport will close itself on error or when the clientconn is closed.
// The created transport must receive initial settings frame from the server.

View File

@ -29,7 +29,6 @@ import (
"regexp"
"runtime"
"strings"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/peer"
@ -41,7 +40,6 @@ const (
windowsCheckCommandArgs = "Get-WmiObject -Class Win32_BIOS"
powershellOutputFilter = "Manufacturer"
windowsManufacturerRegex = ":(.*)"
windowsCheckTimeout = 30 * time.Second
)
type platformError string

View File

@ -104,7 +104,6 @@ type headerFrame struct {
type cleanupStream struct {
streamID uint32
idPtr *uint32
rst bool
rstCode http2.ErrCode
onWrite func()
@ -138,9 +137,6 @@ type outgoingSettings struct {
ss []http2.Setting
}
type settingsAck struct {
}
type incomingGoAway struct {
}

View File

@ -252,7 +252,6 @@ func newTestHandlerResponseWriter() http.ResponseWriter {
type handleStreamTest struct {
t *testing.T
bodyw *io.PipeWriter
req *http.Request
rw testHandlerResponseWriter
ht *serverHandlerTransport
}

View File

@ -42,9 +42,3 @@ func errorf(format string, args ...interface{}) {
grpclog.Errorf(format, args...)
}
}
func fatalf(format string, args ...interface{}) {
if grpclog.V(logLevel) {
grpclog.Fatalf(format, args...)
}
}

View File

@ -176,7 +176,6 @@ type Stream struct {
buf *recvBuffer
trReader io.Reader
fc *inFlow
recvQuota uint32
wq *writeQuota
// Callback to state application's intentions to read data. This

View File

@ -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 {
serverStream int32
serverConn int32

View File

@ -30,10 +30,6 @@ import (
testpb "google.golang.org/grpc/interop/grpc_testing"
)
const (
value = "test_value"
)
var (
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")

View File

@ -156,13 +156,11 @@ type callInfo struct {
compressorType string
failFast bool
stream *clientStream
traceInfo traceInfo // in trace.go
maxReceiveMessageSize *int
maxSendMessageSize *int
creds credentials.PerRPCCredentials
contentSubtype string
codec baseCodec
disableRetry bool
maxRetryRPCBufferSize int
}

View File

@ -403,7 +403,7 @@ const (
inTrailer
outPayload
outHeader
outTrailer
// TODO: test outTrailer ?
connbegin
connend
)

View File

@ -3059,10 +3059,6 @@ func testSetAndSendHeaderStreamingRPC(t *testing.T, e env) {
defer te.tearDown()
tc := testpb.NewTestServiceClient(te.clientConn())
const (
argSize = 1
respSize = 1
)
ctx := metadata.NewOutgoingContext(context.Background(), testMetadata)
stream, err := tc.FullDuplexCall(ctx)
if err != nil {
@ -4659,9 +4655,7 @@ func TestCredsHandshakeAuthority(t *testing.T) {
}
}
type clientFailCreds struct {
got string
}
type clientFailCreds struct{}
func (c *clientFailCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {
return rawConn, nil, nil