Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct { More bool `json:"more,omitempty" bson:"more,omitempty"` Objects []interface{} `json:"objects,omitempty" bson:"objects,omitempty"` }
Envelope - This type implements the TAXII 2 Envelope Resource and defines all of the properties and methods needed to create and work with the TAXII Envelope Resource.
The following information comes directly from the TAXII 2 specification documents.
The envelope is a simple wrapper for STIX 2 content. When returning STIX 2 content in a TAXII response the HTTP root object payload MUST be an envelope. This specification does not define any other form of content wrapper for objects outside of STIX content.
func New ¶
func New() *Envelope
New - This function will create a new TAXII Envelope object and return it as a pointer.
func (*Envelope) AddObject ¶
AddObject - This method will take in an object as an interface and add it to the list of objects in the envelope
func (*Envelope) Encode ¶
Encode - This method is a simple wrapper for encoding an object in to JSON
func (*Envelope) EncodeToString ¶
EncodeToString - This method is a simple wrapper for encoding an object in to JSON
type EnvelopeRawDecode ¶
type EnvelopeRawDecode struct { More bool `json:"more,omitempty" bson:"more,omitempty"` Objects []json.RawMessage `json:"objects,omitempty" bson:"objects,omitempty"` }
EnvelopeRawDecode - This type is used for decoding a TAXII envelope since the Objects property needs special handling.
func DecodeRaw ¶
func DecodeRaw(r io.Reader) (*EnvelopeRawDecode, error)
DecodeRaw - This function will decode the outer layer of an envelope and stop processing when it gets to the objects. It will leave the objects as a slice of json.RawMessage objects. This way, later on, we can decode each one individually
func (*EnvelopeRawDecode) EncodeToString ¶
func (o *EnvelopeRawDecode) EncodeToString() (string, error)
EncodeToString - This method is a simple wrapper for encoding an object in to JSON