indicator

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 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)

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