mirror of https://github.com/grpc/grpc-node.git
				
				
				
			updates
This commit is contained in:
		
							parent
							
								
									7e32e84bca
								
							
						
					
					
						commit
						3995a13d22
					
				|  | @ -1 +1,15 @@ | |||
| export class CallCredentials {} | ||||
| import { Metadata } from './metadata' | ||||
| 
 | ||||
| export class CallCredentials { | ||||
|   static createFromMetadataGenerator(metadataGenerator: (options: Object, cb: (err: Error, metadata: Metadata) => void) => void): CallCredentials { | ||||
|     throw new Error(); | ||||
|   } | ||||
| 
 | ||||
|   call(options: Object, cb: (err: Error, metadata: Metadata) => void): void { | ||||
|     throw new Error(); | ||||
|   } | ||||
| 
 | ||||
|   compose(callCredentials: CallCredentials): CallCredentials { | ||||
|     throw new Error(); | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,17 @@ | |||
| import * as events from 'events'; | ||||
| import * as stream from 'stream'; | ||||
| const { EventEmitter } = events; | ||||
| const { Readable, Writable, Duplex } = stream; | ||||
| 
 | ||||
| export interface Call { | ||||
|   // cancel();
 | ||||
|   // getPeer();
 | ||||
| } | ||||
| 
 | ||||
| export class ClientUnaryCall extends EventEmitter implements Call {} | ||||
| 
 | ||||
| export class ClientReadableStream extends Readable implements Call {} | ||||
| 
 | ||||
| export class ClientWritableStream extends Writable implements Call {} | ||||
| 
 | ||||
| export class ClientDuplexStream extends Duplex implements Call {} | ||||
|  | @ -1,4 +1,5 @@ | |||
| import { CallCredentials } from './call-credentials'; | ||||
| import { SecureContext } from 'tls'; // or whatever it's actually called
 | ||||
| 
 | ||||
| /** | ||||
|  * A class that contains credentials for communicating over a channel. | ||||
|  | @ -17,4 +18,12 @@ export class ChannelCredentials { | |||
|   compose(callCredentials: CallCredentials) : ChannelCredentials { | ||||
|     throw new Error(); | ||||
|   } | ||||
| 
 | ||||
|   getCallCredentials() : CallCredentials { | ||||
|     throw new Error(); | ||||
|   } | ||||
| 
 | ||||
|   getSecureContext() : SecureContext { | ||||
|     throw new Error(); | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -7,6 +7,10 @@ import { Metadata } from './metadata'; | |||
|  */ | ||||
| export interface ChannelOptions {} | ||||
| 
 | ||||
| export class SubChannel {} | ||||
| 
 | ||||
| // todo: maybe we want an interface for load balancing, but no implementation for anything complicated
 | ||||
| 
 | ||||
| /** | ||||
|  * A class that represents a communication channel to a server specified by a given address. | ||||
|  */ | ||||
|  |  | |||
|  | @ -0,0 +1,19 @@ | |||
| import { ClientUnaryCall } from './call' | ||||
| import { Metadata } from './metadata' | ||||
| 
 | ||||
| export interface CallOptions {} | ||||
| 
 | ||||
| export class Client { | ||||
|   makeUnaryRequest<RequestType, ResponseType>( | ||||
|     method: string, | ||||
|     serialize: (value: RequestType) => Buffer, | ||||
|     deserialize: (value: Buffer) => ResponseType, | ||||
|     argument: RequestType, | ||||
|     metadata?: Metadata, | ||||
|     options?: CallOptions, | ||||
|     callback?: (err?: Error, value?: ResponseType) => void | ||||
|   ): ClientUnaryCall { | ||||
|     throw new Error(); | ||||
|   } | ||||
|   // TODO: Do for other method types and overloads
 | ||||
| } | ||||
|  | @ -1 +1,3 @@ | |||
| export class Metadata {} | ||||
| export class Metadata { | ||||
|    | ||||
| } | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| { | ||||
|   "extends": "node_modules/google-ts-style/tsconfig-google.json", | ||||
|   "extends": "./node_modules/google-ts-style/tsconfig-google.json", | ||||
|   "include": [ | ||||
|     "src/*.ts", | ||||
|     "src/**/*.ts", | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue