mirror of https://github.com/grpc/grpc-node.git
grpc-js-core: remove unused variables
This commit removes unused variables reported by temporarily enabling tslint's no-unused-variable rule. Unused function parameters have not been removed.
This commit is contained in:
parent
03c261538b
commit
a97e81f422
|
@ -1,5 +1,3 @@
|
|||
import {promisify} from 'util';
|
||||
|
||||
import {CallCredentials} from './call-credentials';
|
||||
import {Call} from './call-stream';
|
||||
import {Http2Channel} from './channel';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {map, reduce} from 'lodash';
|
||||
import {map} from 'lodash';
|
||||
|
||||
import {Metadata} from './metadata';
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import * as http2 from 'http2';
|
||||
import {Meta} from 'orchestrator';
|
||||
import {Duplex} from 'stream';
|
||||
|
||||
import {CallCredentials} from './call-credentials';
|
||||
import {Channel, Http2Channel} from './channel';
|
||||
import {Http2Channel} from './channel';
|
||||
import {Status} from './constants';
|
||||
import {EmitterAugmentation1} from './events';
|
||||
import {Filter} from './filter';
|
||||
|
@ -67,12 +66,9 @@ enum ReadState {
|
|||
READING_MESSAGE
|
||||
}
|
||||
|
||||
const emptyBuffer = Buffer.alloc(0);
|
||||
|
||||
export class Http2CallStream extends Duplex implements Call {
|
||||
credentials: CallCredentials = CallCredentials.createEmpty();
|
||||
filterStack: Filter;
|
||||
private statusEmitted = false;
|
||||
private http2Stream: http2.ClientHttp2Stream|null = null;
|
||||
private pendingRead = false;
|
||||
private pendingWrite: Buffer|null = null;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {EventEmitter} from 'events';
|
||||
import * as _ from 'lodash';
|
||||
import {Duplex, Readable, Writable} from 'stream';
|
||||
|
||||
import {Call, StatusObject, WriteObject} from './call-stream';
|
||||
|
@ -87,8 +86,6 @@ function setUpReadableStream<ResponseType>(
|
|||
});
|
||||
call.on('status', (status: StatusObject) => {
|
||||
if (status.code !== Status.OK) {
|
||||
const statusName = _.invert(Status)[status.code];
|
||||
const message = `${status.code} ${statusName}: ${status.details}`;
|
||||
const error: ServiceError =
|
||||
Object.assign(new Error(status.details), status);
|
||||
stream.emit('error', error);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {ConnectionOptions, createSecureContext, PeerCertificate, SecureContext, TLSSocket} from 'tls';
|
||||
import {ConnectionOptions, createSecureContext, PeerCertificate} from 'tls';
|
||||
|
||||
import {CallCredentials} from './call-credentials';
|
||||
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
import {EventEmitter} from 'events';
|
||||
import * as http2 from 'http2';
|
||||
import {checkServerIdentity, PeerCertificate, SecureContext} from 'tls';
|
||||
import {checkServerIdentity, PeerCertificate} from 'tls';
|
||||
import * as url from 'url';
|
||||
|
||||
import {CallCredentials} from './call-credentials';
|
||||
import {CallCredentialsFilterFactory} from './call-credentials-filter';
|
||||
import {Call, CallStreamOptions, Deadline, Http2CallStream, PartialCallStreamOptions} from './call-stream';
|
||||
import {Call, CallStreamOptions, Deadline, Http2CallStream} from './call-stream';
|
||||
import {ChannelCredentials} from './channel-credentials';
|
||||
import {ChannelOptions, recognizedOptions} from './channel-options';
|
||||
import {CompressionFilterFactory} from './compression-filter';
|
||||
import {Status} from './constants';
|
||||
import {DeadlineFilterFactory} from './deadline-filter';
|
||||
import {FilterStackFactory} from './filter-stack';
|
||||
import {Metadata, MetadataObject} from './metadata';
|
||||
import {Metadata} from './metadata';
|
||||
import {MetadataStatusFilterFactory} from './metadata-status-filter';
|
||||
import {Http2SubChannel} from './subchannel';
|
||||
|
||||
const {version: clientVersion} = require('../../package');
|
||||
|
||||
const IDLE_TIMEOUT_MS = 300000;
|
||||
|
||||
const MIN_CONNECT_TIMEOUT_MS = 20000;
|
||||
const INITIAL_BACKOFF_MS = 1000;
|
||||
const BACKOFF_MULTIPLIER = 1.6;
|
||||
|
@ -31,7 +28,6 @@ const {
|
|||
HTTP2_HEADER_CONTENT_TYPE,
|
||||
HTTP2_HEADER_METHOD,
|
||||
HTTP2_HEADER_PATH,
|
||||
HTTP2_HEADER_SCHEME,
|
||||
HTTP2_HEADER_TE,
|
||||
HTTP2_HEADER_USER_AGENT
|
||||
} = http2.constants;
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
import {once} from 'lodash';
|
||||
import {URL} from 'url';
|
||||
|
||||
import {ClientDuplexStream, ClientDuplexStreamImpl, ClientReadableStream, ClientReadableStreamImpl, ClientUnaryCall, ClientUnaryCallImpl, ClientWritableStream, ClientWritableStreamImpl, ServiceError} from './call';
|
||||
import {CallCredentials} from './call-credentials';
|
||||
import {Call, Deadline, PartialCallStreamOptions, StatusObject, WriteObject} from './call-stream';
|
||||
import {Call, Deadline, StatusObject, WriteObject} from './call-stream';
|
||||
import {Channel, ConnectivityState, Http2Channel} from './channel';
|
||||
import {ChannelCredentials} from './channel-credentials';
|
||||
import {ChannelOptions} from './channel-options';
|
||||
|
|
|
@ -2,7 +2,6 @@ import * as zlib from 'zlib';
|
|||
|
||||
import {Call, WriteFlags, WriteObject} from './call-stream';
|
||||
import {Channel} from './channel';
|
||||
import {Status} from './constants';
|
||||
import {BaseFilter, Filter, FilterFactory} from './filter';
|
||||
import {Metadata, MetadataValue} from './metadata';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Call} from './call-stream';
|
||||
import {Channel, ConnectivityState, Http2Channel} from './channel';
|
||||
import {ConnectivityState, Http2Channel} from './channel';
|
||||
import {Status} from './constants';
|
||||
import {BaseFilter, Filter, FilterFactory} from './filter';
|
||||
import {Metadata} from './metadata';
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
import {IncomingHttpHeaders} from 'http';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import {CallCredentials} from './call-credentials';
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import * as _ from 'lodash';
|
||||
|
||||
import {PartialCallStreamOptions} from './call-stream';
|
||||
import {ChannelCredentials} from './channel-credentials';
|
||||
import {ChannelOptions} from './channel-options';
|
||||
import {Client, UnaryCallback} from './client';
|
||||
import {Metadata} from './metadata';
|
||||
import {Client} from './client';
|
||||
|
||||
export interface Serialize<T> { (value: T): Buffer; }
|
||||
|
||||
|
@ -27,11 +25,6 @@ export interface ServiceDefinition {
|
|||
|
||||
export interface PackageDefinition { [index: string]: ServiceDefinition; }
|
||||
|
||||
function getDefaultValues<T>(metadata?: Metadata, options?: T):
|
||||
{metadata: Metadata; options: Partial<T>;} {
|
||||
return {metadata: metadata || new Metadata(), options: options || {}};
|
||||
}
|
||||
|
||||
/**
|
||||
* Map with short names for each of the requester maker functions. Used in
|
||||
* makeClientConstructor
|
||||
|
|
|
@ -2,9 +2,8 @@ import {EventEmitter} from 'events';
|
|||
import * as http2 from 'http2';
|
||||
import * as url from 'url';
|
||||
|
||||
import {Call, Http2CallStream, PartialCallStreamOptions} from './call-stream';
|
||||
import {Call, Http2CallStream} from './call-stream';
|
||||
import {ChannelOptions} from './channel-options';
|
||||
import {EmitterAugmentation0, EmitterAugmentation1} from './events';
|
||||
import {Metadata} from './metadata';
|
||||
|
||||
const {
|
||||
|
@ -12,7 +11,6 @@ const {
|
|||
HTTP2_HEADER_CONTENT_TYPE,
|
||||
HTTP2_HEADER_METHOD,
|
||||
HTTP2_HEADER_PATH,
|
||||
HTTP2_HEADER_SCHEME,
|
||||
HTTP2_HEADER_TE,
|
||||
HTTP2_HEADER_USER_AGENT
|
||||
} = http2.constants;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import * as assert from 'assert';
|
||||
import {EventEmitter} from 'events';
|
||||
import * as http2 from 'http2';
|
||||
import {forOwn, range} from 'lodash';
|
||||
import {range} from 'lodash';
|
||||
import * as stream from 'stream';
|
||||
|
||||
import {CallCredentials} from '../src/call-credentials';
|
||||
|
|
Loading…
Reference in New Issue