Skip to content

Commit

Permalink
Rename expectChannel to expectTunnel
Browse files Browse the repository at this point in the history
I think I'm using the word 'channel' for the individual streams within a
connection, and the word 'tunnel' for the overall bundle of streams that
are going over a given TCP socket.
  • Loading branch information
danopia committed Aug 5, 2023
1 parent 6454447 commit c1d980c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface RequestOptions {
bodyStream?: ReadableStream<Uint8Array>;

accept?: string;
expectChannel?: string[];
expectTunnel?: string[];
expectStream?: boolean;
expectJson?: boolean;
}
Expand Down Expand Up @@ -54,7 +54,7 @@ export interface ChannelTunnel {
}

export interface RestClient {
performRequest(opts: RequestOptions & {expectChannel: string[]}): Promise<ChannelTunnel>;
performRequest(opts: RequestOptions & {expectTunnel: string[]}): Promise<ChannelTunnel>;
performRequest(opts: RequestOptions & {expectStream: true; expectJson: true}): Promise<ReadableStream<JSONValue>>;
performRequest(opts: RequestOptions & {expectStream: true}): Promise<ReadableStream<Uint8Array>>;
performRequest(opts: RequestOptions & {expectJson: true}): Promise<JSONValue>;
Expand Down
2 changes: 1 addition & 1 deletion transports/via-kubeconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class KubeConfigRestClient implements RestClient {
console.error(opts.method, path);
}

if (opts.expectChannel) throw new Error(
if (opts.expectTunnel) throw new Error(
`Channel-based APIs are not currently implemented by this client.`);

const headers: Record<string, string> = {};
Expand Down
2 changes: 1 addition & 1 deletion transports/via-kubectl-raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class KubectlRawRestClient implements RestClient {
const hasReqBody = opts.bodyJson !== undefined || !!opts.bodyRaw || !!opts.bodyStream;
isVerbose && console.error(opts.method, path, hasReqBody ? '(w/ body)' : '');

if (opts.expectChannel) throw new Error(
if (opts.expectTunnel) throw new Error(
`Channel-based APIs are not currently implemented by this client.`);

let rawArgs = [command, ...(hasReqBody ? ['-f', '-'] : []), "--raw", path];
Expand Down

0 comments on commit c1d980c

Please sign in to comment.