diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-24 23:29:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 23:29:14 +0200 |
commit | 6a37e4426e686028c38d5e915d91e587c5966804 (patch) | |
tree | c1bedaeb2e6137fc023b6e125a56d4cba848add2 /cli/js/tls.ts | |
parent | 6efdacddf30b5247b66596a44226687ff21a8f80 (diff) |
BREAKING CHANGE: rename TLS APIs to camel case (#4888)
This commit renames all APIs containing "TLS" to use camel case
(connectTLS -> connectTls, etc.)
Diffstat (limited to 'cli/js/tls.ts')
-rw-r--r-- | cli/js/tls.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/cli/js/tls.ts b/cli/js/tls.ts index f60eb24cb..270d724bb 100644 --- a/cli/js/tls.ts +++ b/cli/js/tls.ts @@ -4,20 +4,20 @@ import { Listener, Conn, ConnImpl, ListenerImpl } from "./net.ts"; // TODO(ry) There are many configuration options to add... // https://docs.rs/rustls/0.16.0/rustls/struct.ClientConfig.html -interface ConnectTLSOptions { +interface ConnectTlsOptions { transport?: "tcp"; port: number; hostname?: string; certFile?: string; } -export async function connectTLS({ +export async function connectTls({ port, hostname = "127.0.0.1", transport = "tcp", certFile = undefined, -}: ConnectTLSOptions): Promise<Conn> { - const res = await tlsOps.connectTLS({ +}: ConnectTlsOptions): Promise<Conn> { + const res = await tlsOps.connectTls({ port, hostname, transport, @@ -33,7 +33,7 @@ class TLSListenerImpl extends ListenerImpl { } } -export interface ListenTLSOptions { +export interface ListenTlsOptions { port: number; hostname?: string; transport?: "tcp"; @@ -41,14 +41,14 @@ export interface ListenTLSOptions { keyFile: string; } -export function listenTLS({ +export function listenTls({ port, certFile, keyFile, hostname = "0.0.0.0", transport = "tcp", -}: ListenTLSOptions): Listener { - const res = tlsOps.listenTLS({ +}: ListenTlsOptions): Listener { + const res = tlsOps.listenTls({ port, certFile, keyFile, @@ -58,16 +58,16 @@ export function listenTLS({ return new TLSListenerImpl(res.rid, res.localAddr); } -interface StartTLSOptions { +interface StartTlsOptions { hostname?: string; certFile?: string; } -export async function startTLS( +export async function startTls( conn: Conn, - { hostname = "127.0.0.1", certFile = undefined }: StartTLSOptions = {} + { hostname = "127.0.0.1", certFile = undefined }: StartTlsOptions = {} ): Promise<Conn> { - const res = await tlsOps.startTLS({ + const res = await tlsOps.startTls({ rid: conn.rid, hostname, certFile, |