bundle

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package bundle implements the STIX 2.1 Bundle object.

The following information comes directly from the STIX 2.1 specification.

A Bundle is a collection of arbitrary STIX Objects grouped together in a single container. A Bundle does not have any semantic meaning and the objects contained within the Bundle are not considered related by virtue of being in the same Bundle.

A STIX Bundle Object is not a STIX Object but makes use of the type and id Common Properties. A Bundle is transient, and implementations SHOULD NOT assume that other implementations will treat it as a persistent object or keep any custom properties found on the bundle itself.

The JSON MTI serialization uses the JSON Object type [RFC8259] when representing bundle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	objects.CommonObjectProperties
	Objects []objects.STIXObject `json:"objects,omitempty"`
}

Bundle - This type implements the STIX 2 Bundle SDO 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.

func Decode added in v0.6.1

func Decode(r io.Reader) (*Bundle, []error)

Decode - This function will decode a bundle and return the object as a pointer along with any errors found.

func New

func New() *Bundle

New - This function will create a new STIX Bundle object and return it as a pointer. This function can not use the InitNewObject() function as a Bundle does not have all of the fields that are common to a standard object.

func (*Bundle) AddObject

func (o *Bundle) AddObject(i objects.STIXObject) error

AddObject - This method will take in an object as an interface and add it to the list of objects in the bundle.

func (*Bundle) Encode

func (o *Bundle) Encode() ([]byte, error)

Encode - This method is a simple wrapper for encoding an object into JSON

func (*Bundle) EncodeToString

func (o *Bundle) EncodeToString() (string, error)

EncodeToString - This method is a simple wrapper for encoding an object into JSON

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL