rename dial to connect and dialTLS to connectTLS (#3710)

This commit is contained in:
Bartek Iwańczuk 2020-01-18 18:35:12 +01:00 committed by GitHub
parent 4f1fa82d1d
commit 34b99fec8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 61 additions and 72 deletions

View file

@ -1307,7 +1307,7 @@ declare namespace Deno {
interface Addr {
transport: Transport;
/** UNSTABLE: Address is unstable because inconsistent with DialOptions. */
/** UNSTABLE: Address is unstable because inconsistent with ConnectOptions. */
address: string;
}
@ -1419,15 +1419,13 @@ declare namespace Deno {
*/
export function listenTLS(options: ListenTLSOptions): Listener;
/** UNSTABLE rename to ConnectOptions */
export interface DialOptions {
export interface ConnectOptions {
port: number;
hostname?: string;
transport?: Transport;
}
/** UNSTABLE: Rename to connect.
*
/**
* Dial connects to the address on the named transport.
*
* @param options
@ -1440,25 +1438,23 @@ declare namespace Deno {
*
* Examples:
*
* dial({ port: 80 })
* dial({ hostname: "192.0.2.1", port: 80 })
* dial({ hostname: "[2001:db8::1]", port: 80 });
* dial({ hostname: "golang.org", port: 80, transport: "tcp" })
* connect({ port: 80 })
* connect({ hostname: "192.0.2.1", port: 80 })
* connect({ hostname: "[2001:db8::1]", port: 80 });
* connect({ hostname: "golang.org", port: 80, transport: "tcp" })
*/
export function dial(options: DialOptions): Promise<Conn>;
export function connect(options: ConnectOptions): Promise<Conn>;
/** UNSTABLE: rename to ConnectTLSOptions */
export interface DialTLSOptions {
export interface ConnectTLSOptions {
port: number;
hostname?: string;
certFile?: string;
}
/** UNSTABLE: rename to connectTLS.
*
* dialTLS establishes a secure connection over TLS (transport layer security).
/**
* Establishes a secure connection over TLS (transport layer security).
*/
export function dialTLS(options: DialTLSOptions): Promise<Conn>;
export function connectTLS(options: ConnectTLSOptions): Promise<Conn>;
/** UNSTABLE: not sure if broken or not */
export interface Metrics {