feat(cluster): add clustered storage backend with QUIC transport, erasure coding, and shard management
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartstorage',
|
||||
version: '6.0.1',
|
||||
version: '6.1.0',
|
||||
description: 'A Node.js TypeScript package to create a local S3-compatible storage server using mapped local directories for development and testing purposes.'
|
||||
}
|
||||
|
||||
34
ts/index.ts
34
ts/index.ts
@@ -69,6 +69,36 @@ export interface IStorageConfig {
|
||||
cleanSlate?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erasure coding configuration
|
||||
*/
|
||||
export interface IErasureConfig {
|
||||
dataShards?: number;
|
||||
parityShards?: number;
|
||||
chunkSizeBytes?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drive configuration for multi-drive support
|
||||
*/
|
||||
export interface IDriveConfig {
|
||||
paths: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Cluster configuration for distributed mode
|
||||
*/
|
||||
export interface IClusterConfig {
|
||||
enabled: boolean;
|
||||
nodeId?: string;
|
||||
quicPort?: number;
|
||||
seedNodes?: string[];
|
||||
erasure?: IErasureConfig;
|
||||
drives?: IDriveConfig;
|
||||
heartbeatIntervalMs?: number;
|
||||
heartbeatTimeoutMs?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Complete smartstorage configuration
|
||||
*/
|
||||
@@ -80,6 +110,7 @@ export interface ISmartStorageConfig {
|
||||
logging?: ILoggingConfig;
|
||||
limits?: ILimitsConfig;
|
||||
multipart?: IMultipartConfig;
|
||||
cluster?: IClusterConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,7 +194,8 @@ function mergeConfig(userConfig: ISmartStorageConfig): Required<ISmartStorageCon
|
||||
...DEFAULT_CONFIG.multipart!,
|
||||
...(userConfig.multipart || {}),
|
||||
},
|
||||
};
|
||||
...(userConfig.cluster ? { cluster: userConfig.cluster } : {}),
|
||||
} as Required<ISmartStorageConfig>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user