Setting up the model resolution design.
This commit is contained in:
25
src/model/struct/distribution.struct.ts
Normal file
25
src/model/struct/distribution.struct.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Distribution } from '../spec/distribution'
|
||||
import { ModelStructure } from './model.struct'
|
||||
import { ServerStructure } from './server.struct'
|
||||
|
||||
export class DistributionStructure implements ModelStructure<Distribution> {
|
||||
|
||||
private servers: ServerStructure[] | undefined
|
||||
|
||||
constructor(
|
||||
private root: string
|
||||
) {}
|
||||
|
||||
public getServers() {
|
||||
return new ServerStructure(this.root).getSpecModel()
|
||||
}
|
||||
|
||||
public getSpecModel(): Distribution {
|
||||
return {
|
||||
version: '1.0.0',
|
||||
rss: 'TODO',
|
||||
servers: this.getServers()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user