config: Add simple device config schema

This commit is contained in:
Danny Lin 2021-11-09 19:47:54 -08:00
parent 89047636a7
commit edb2e3fecc

18
src/config/device.ts Normal file
View file

@ -0,0 +1,18 @@
import * as YAML from 'yaml'
export interface DeviceInfo {
name: string
vendor: string
}
export interface DeviceConfig {
device: DeviceInfo
namespaces?: Array<string>
sepolicy_dirs: Array<string>
includes: Array<string>
filters: { [name: string]: Array<string> }
}
export function parseDeviceConfig(config: string) {
return YAML.parse(config) as DeviceConfig
}