Documentation ¶
Index ¶
- func ConvertToModel(root *Root) ([]models.Definition, error)
- type Advisory
- type Affected
- type Bug
- type ConstantVariable
- type Criteria
- type Criterion
- type Definition
- type Definitions
- type Generator
- type ObjectRef
- type Objects
- type Ref
- type Reference
- type Root
- type StateRef
- type States
- type Tests
- type Textfilecontent54Object
- type Textfilecontent54State
- type Textfilecontent54Test
- type Variables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToModel ¶
func ConvertToModel(root *Root) ([]models.Definition, error)
ConvertToModel Convert OVAL to models
Types ¶
type Advisory ¶
type Advisory struct { XMLName xml.Name `xml:"advisory"` Severity string `xml:"severity"` Rights string `xml:"rights"` PublicDate string `xml:"public_date"` Refs []Ref `xml:"ref"` Bugs []Bug `xml:"bug"` }
Advisory : >definitions>definition>metadata>advisory
type Affected ¶
type Affected struct { XMLName xml.Name `xml:"affected"` Family string `xml:"family,attr"` Platforms []string `xml:"platform"` }
Affected : >definitions>definition>metadata>affected
type ConstantVariable ¶
type ConstantVariable struct { Text string `xml:",chardata"` ID string `xml:"id,attr"` Version string `xml:"version,attr"` Datatype string `xml:"datatype,attr"` Comment string `xml:"comment,attr"` Value []string `xml:"value"` }
ConstantVariable : >variables>constant_variable
type Criteria ¶
type Criteria struct { XMLName xml.Name `xml:"criteria"` Operator string `xml:"operator,attr"` Criterias []Criteria `xml:"criteria"` Criterions []Criterion `xml:"criterion"` }
Criteria : >definitions>definition>criteria
type Criterion ¶
type Criterion struct { XMLName xml.Name `xml:"criterion"` TestRef string `xml:"test_ref,attr"` Comment string `xml:"comment,attr"` }
Criterion : >definitions>definition>criteria>*>criterion
type Definition ¶
type Definition struct { XMLName xml.Name `xml:"definition"` ID string `xml:"id,attr"` Class string `xml:"class,attr"` Title string `xml:"metadata>title"` Affecteds []Affected `xml:"metadata>affected"` References []Reference `xml:"metadata>reference"` Description string `xml:"metadata>description"` Advisory Advisory `xml:"metadata>advisory"` Notes struct { Text string `xml:",chardata"` Note string `xml:"note"` } `xml:"notes"` Criteria Criteria `xml:"criteria"` }
Definition : >definitions>definition
type Definitions ¶
type Definitions struct { XMLName xml.Name `xml:"definitions"` Definitions []Definition `xml:"definition"` }
Definitions : >definitions
type Generator ¶
type Generator struct { XMLName xml.Name `xml:"generator"` ProductName string `xml:"product_name"` ProductVersion string `xml:"product_version"` SchemaVersion string `xml:"schema_version"` Timestamp string `xml:"timestamp"` }
Generator : >generator
type ObjectRef ¶
type ObjectRef struct { XMLName xml.Name `xml:"object"` Text string `xml:",chardata"` ObjectRef string `xml:"object_ref,attr"` }
ObjectRef : >tests>textfilecontent54_test>object-object_ref
type Objects ¶
type Objects struct { XMLName xml.Name `xml:"objects"` Textfilecontent54Object []Textfilecontent54Object `xml:"textfilecontent54_object"` }
Objects : >objects
type Reference ¶
type Reference struct { XMLName xml.Name `xml:"reference"` Source string `xml:"source,attr"` RefID string `xml:"ref_id,attr"` RefURL string `xml:"ref_url,attr"` }
Reference : >definitions>definition>metadata>reference
type Root ¶
type Root struct { XMLName xml.Name `xml:"oval_definitions"` Generator Generator `xml:"generator"` Definitions Definitions `xml:"definitions"` Tests Tests `xml:"tests"` Objects Objects `xml:"objects"` States States `xml:"states"` Variables Variables `xml:"variables"` }
Root : root object
type StateRef ¶
type StateRef struct { XMLName xml.Name `xml:"state"` Text string `xml:",chardata"` StateRef string `xml:"state_ref,attr"` }
StateRef : >tests>textfilecontent54_test>state-state_ref
type States ¶
type States struct { XMLName xml.Name `xml:"states"` Textfilecontent54State []Textfilecontent54State `xml:"textfilecontent54_state"` }
States : >states
type Tests ¶
type Tests struct { XMLName xml.Name `xml:"tests"` Textfilecontent54Test []Textfilecontent54Test `xml:"textfilecontent54_test"` }
Tests : >tests
type Textfilecontent54Object ¶
type Textfilecontent54Object struct { ID string `xml:"id,attr"` Comment string `xml:"comment,attr"` Path string `xml:"path"` Filename string `xml:"filename"` Pattern struct { Text string `xml:",chardata"` Operation string `xml:"operation,attr"` Datatype string `xml:"datatype,attr"` VarRef string `xml:"var_ref,attr"` VarCheck string `xml:"var_check,attr"` } `xml:"pattern"` Instance struct { Text string `xml:",chardata"` Operation string `xml:"operation,attr"` Datatype string `xml:"datatype,attr"` } `xml:"instance"` }
Textfilecontent54Object : >objects>textfilecontent54_object
type Textfilecontent54State ¶
type Textfilecontent54State struct { ID string `xml:"id,attr"` Comment string `xml:"comment,attr"` Subexpression struct { Text string `xml:",chardata"` Datatype string `xml:"datatype,attr"` Operation string `xml:"operation,attr"` } `xml:"subexpression"` }
Textfilecontent54State : >states>textfilecontent54_state
type Textfilecontent54Test ¶
type Textfilecontent54Test struct { ID string `xml:"id,attr"` Check string `xml:"check,attr"` CheckExistence string `xml:"check_existence,attr"` Comment string `xml:"comment,attr"` Object ObjectRef `xml:"object"` State StateRef `xml:"state"` }
Textfilecontent54Test : >tests>textfilecontent54_test
type Variables ¶
type Variables struct { XMLName xml.Name `xml:"variables"` ConstantVariable []ConstantVariable `xml:"constant_variable"` }
Variables : >variables