forked from freetaxii/libstix2
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
45 lines (38 loc) · 1.6 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2015-2020 Bret Jordan, All rights reserved.
//
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file in the root of the source tree.
package domainname
import (
"github.com/freetaxii/libstix2/objects"
"github.com/freetaxii/libstix2/objects/properties"
)
// ----------------------------------------------------------------------
// Define Object Model
// ----------------------------------------------------------------------
/* DomainName - This type implements the STIX 2 Domain Name SCO and defines
all of the properties and methods needed to create and work with this object.
All of the methods not defined local to this type are inherited from the
individual properties. */
type DomainName struct {
objects.CommonObjectProperties
properties.ValueProperty
properties.ResolvesToRefsProperty
}
/* GetProperties - This method will return a list of all of the properties that
are unique to this object. This is used by the custom UnmarshalJSON for this
object. It is defined here in this file to make it easy to keep in sync. */
func (o *DomainName) GetPropertyList() []string {
return []string{"value", "resolves_to_refs"}
}
// ----------------------------------------------------------------------
// Initialization Functions
// ----------------------------------------------------------------------
/* New - This function will create a new STIX Domain Name SCO and return it as a
pointer. It will also initialize the object by setting all of the basic
properties. */
func New() *DomainName {
var obj DomainName
obj.InitSCO("domain-name")
return &obj
}