github.com/opencontainers/runtime-tools@v0.9.0/specerror/config-windows.go (about) 1 package specerror 2 3 import ( 4 "fmt" 5 6 rfc2119 "github.com/opencontainers/runtime-tools/error" 7 ) 8 9 // define error codes 10 const ( 11 // WindowsLayerFoldersRequired represents "`layerFolders` MUST contain at least one entry." 12 WindowsLayerFoldersRequired Code = 0xd001 + iota 13 // WindowsHyperVPresent represents "If present, the container MUST be run with Hyper-V isolation." 14 WindowsHyperVPresent 15 // WindowsHyperVOmit represents "If omitted, the container MUST be run as a Windows Server container." 16 WindowsHyperVOmit 17 ) 18 19 var ( 20 layerfoldersRef = func(version string) (reference string, err error) { 21 return fmt.Sprintf(referenceTemplate, version, "config-windows.md#layerfolders"), nil 22 } 23 hypervRef = func(version string) (reference string, err error) { 24 return fmt.Sprintf(referenceTemplate, version, "config-windows.md#hyperv"), nil 25 } 26 ) 27 28 func init() { 29 register(WindowsLayerFoldersRequired, rfc2119.Must, layerfoldersRef) 30 register(WindowsHyperVPresent, rfc2119.Must, hypervRef) 31 register(WindowsHyperVOmit, rfc2119.Must, hypervRef) 32 }