indicator

package
v0.7.17 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiVersionFromYAML added in v0.7.15

func ApiVersionFromYAML(docBytes []byte) (string, error)

func ApplyPatches

func ApplyPatches(patches []Patch, documentBytes []byte) ([]byte, error)

func DocumentFromYAML added in v0.7.15

func DocumentFromYAML(r io.ReadCloser) (v1.IndicatorDocument, error)

func KindFromYAML added in v0.7.15

func KindFromYAML(fileBytes []byte) (string, error)

func MatchDocument

func MatchDocument(patch Patch, documentBytes []byte) bool

func MetadataFromYAML added in v0.7.15

func MetadataFromYAML(reader io.ReadCloser) (map[string]string, error)

func OverrideMetadata

func OverrideMetadata(overrideMetadata map[string]string) func(options *readOptions)

func ParseMetadata

func ParseMetadata(input string) map[string]string

func ProcessDocument

func ProcessDocument(patches []Patch, documentBytes []byte) (v1.IndicatorDocument, []error)

func ProductFromYAML added in v0.7.15

func ProductFromYAML(reader io.ReadCloser) (v1.Product, error)

func ReadFile

func ReadFile(indicatorsFile string, opts ...ReadOpt) (IndicatorDocument, error)

Reads the IndicatorDocument in the file with the given name, Returns an error if the file can't be read, or the file isn't valid YAML parsable as a document, or the document can't be validated.

func SkipMetadataInterpolation

func SkipMetadataInterpolation(options *readOptions)

Types

type Match

type Match struct {
	Name     *string
	Version  *string
	Metadata map[string]string
}

type Patch

type Patch struct {
	APIVersion string
	Match      Match
	Operations []patch.OpDefinition
}

func PatchFromYAML added in v0.7.15

func PatchFromYAML(reader io.ReadCloser) (Patch, error)

func ReadPatchFile

func ReadPatchFile(patchFile string) (Patch, error)

type ReadOpt

type ReadOpt func(options *readOptions)

Jump to

Keyboard shortcuts

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