Skip to content

Commit e138e40

Browse files
authored
fix: Support only tcp network (#23)
1 parent 244f6a4 commit e138e40

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/grpc/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import winston from 'winston';
55
import { DiscoveryServer } from './discovery.js';
66
import { PluginServer } from './plugin.js';
77

8+
export enum Network {
9+
TCP = 'tcp',
10+
}
11+
812
export const getServer = () => {
913
const server = new grpc.Server();
1014
server.addService(pluginV3.cloudquery.plugin.v3.UnimplementedPluginService.definition, new PluginServer());

src/serve/serve.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import yargs from 'yargs';
22
import { hideBin } from 'yargs/helpers';
33

4-
import { startServer } from '../grpc/server.js';
4+
import { startServer, Network } from '../grpc/server.js';
55
import { LogFormat, LogLevel, createLogger } from '../logger/logger.js';
66

7-
const NETWORK_CHOICES = ['tcp', 'tcp4', 'tcp6', 'unix', 'unixpacket'] as const;
8-
97
const TELEMETRY_LEVEL_CHOICES = ['none', 'errors', 'stats', 'all'] as const;
108

119
export type ServeArguments = {
1210
address: string;
13-
network: (typeof NETWORK_CHOICES)[number];
11+
network: Network;
1412
logLevel: LogLevel;
1513
logFormat: LogFormat;
1614
sentry: boolean;
@@ -40,7 +38,7 @@ export const serve = yargs(hideBin(process.argv))
4038
network: {
4139
alias: 'n',
4240
type: 'string',
43-
choices: NETWORK_CHOICES,
41+
choices: Object.values(Network),
4442
description: 'network to bind to',
4543
default: 'tcp',
4644
},

0 commit comments

Comments
 (0)