1
0
mirror of https://github.com/seejohnrun/haste-server.git synced 2025-12-26 04:01:29 +00:00
Files
haste-server/src/types/config.ts
Yusuf Yilmaz a5b0a98b3f add prettier
2022-06-06 19:44:11 +02:00

81 lines
1.6 KiB
TypeScript

import { Logging } from './log'
import { RateLimits } from './rate-limits'
export interface Config {
host: string
port: number
keyLength: number
maxLength: number
staticMaxAge: number
recompressStaticAssets: boolean
logging: Logging[]
keyGenerator: KeyGeneratorConfig
rateLimits: RateLimits
storage: StoreConfig
documents: Record<string, string>
}
export type BaseStoreConfig = {
type: string
expire?: number
}
export interface MongoStoreConfig extends BaseStoreConfig {
connectionUrl: string
}
export interface MemcachedStoreConfig extends BaseStoreConfig {
host: string
port: number
}
export interface FileStoreConfig extends BaseStoreConfig {
path: string
}
export interface AmazonStoreConfig extends BaseStoreConfig {
bucket: string
region: string
}
export interface PostgresStoreConfig extends BaseStoreConfig {
connectionUrl: string
}
export interface RethinkDbStoreConfig extends BaseStoreConfig {
host: string
port: string
db: string
user: string
password: string
}
export interface RedisStoreConfig extends BaseStoreConfig {
url?: string
db?: string
user?: string
username?: string | undefined
password?: string
host?: string
port?: string
}
export type GoogleStoreConfig = BaseStoreConfig
export type StoreConfig =
| MongoStoreConfig
| MemcachedStoreConfig
| GoogleStoreConfig
| AmazonStoreConfig
| FileStoreConfig
| MongoStoreConfig
| RedisStoreConfig
| RethinkDbStoreConfig
| PostgresStoreConfig
export interface KeyGeneratorConfig {
type: string
keyspace?: string
path?: string
}