1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-21 18:21:36 +02:00

[Config] Handle kafka

This commit is contained in:
Diego Magdaleno 2021-07-29 09:56:00 -05:00
parent e0acff92c1
commit b96bed64a3
No known key found for this signature in database
GPG Key ID: 48CD529B9FD561E8

View File

@ -33,6 +33,11 @@ export interface Region {
optimal: boolean,
}
export interface KafkaBroker {
ip: string,
port: number
}
export interface DefaultOptions {
gateway: {
endpoint: string | null;
@ -129,6 +134,9 @@ export interface DefaultOptions {
default: string;
available: Region[];
}
kafka: {
brokers: KafkaBroker[]
}
}
export const DefaultOptions: DefaultOptions = {
@ -222,14 +230,19 @@ export const DefaultOptions: DefaultOptions = {
},
regions: {
default: "fosscord",
available: [
available: [
{ id: "fosscord", name: "Fosscord", vip: false, custom: false, deprecated: false, optimal: false },
]
},
kafka: {
brokers: [
{ ip: "localhost", port: 9092 }
]
}
};
export const ConfigSchema = new Schema({}, { strict: false });
export interface DefaultOptionsDocument extends DefaultOptions, Document {}
export interface DefaultOptionsDocument extends DefaultOptions, Document { }
export const ConfigModel = model<DefaultOptionsDocument>("Config", ConfigSchema, "config");