indicator

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, opts ...ReadOpt) (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