Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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