Skip to content

Commit

Permalink
fix: Support only tcp network (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Aug 8, 2023
1 parent 244f6a4 commit e138e40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/grpc/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import winston from 'winston';
import { DiscoveryServer } from './discovery.js';
import { PluginServer } from './plugin.js';

export enum Network {
TCP = 'tcp',
}

export const getServer = () => {
const server = new grpc.Server();
server.addService(pluginV3.cloudquery.plugin.v3.UnimplementedPluginService.definition, new PluginServer());
Expand Down
8 changes: 3 additions & 5 deletions src/serve/serve.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

import { startServer } from '../grpc/server.js';
import { startServer, Network } from '../grpc/server.js';
import { LogFormat, LogLevel, createLogger } from '../logger/logger.js';

const NETWORK_CHOICES = ['tcp', 'tcp4', 'tcp6', 'unix', 'unixpacket'] as const;

const TELEMETRY_LEVEL_CHOICES = ['none', 'errors', 'stats', 'all'] as const;

export type ServeArguments = {
address: string;
network: (typeof NETWORK_CHOICES)[number];
network: Network;
logLevel: LogLevel;
logFormat: LogFormat;
sentry: boolean;
Expand Down Expand Up @@ -40,7 +38,7 @@ export const serve = yargs(hideBin(process.argv))
network: {
alias: 'n',
type: 'string',
choices: NETWORK_CHOICES,
choices: Object.values(Network),
description: 'network to bind to',
default: 'tcp',
},
Expand Down

0 comments on commit e138e40

Please sign in to comment.