provenance

package
v0.0.0-...-6f5f0be Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Namespace string

	KindPluralMap map[string]string

	REPLICA_SET  string
	DEPLOYMENT   string
	POD          string
	CONFIG_MAP   string
	SERVICE      string
	ETCD_CLUSTER string

	AllProvenanceObjects []ProvenanceOfObject
)

Functions

func CollectProvenance

func CollectProvenance()

Types

type Composition

type Composition struct {
	Level    int
	Kind     string
	Name     string
	Status   string
	Children []Composition
}

Used for Final output

type Event

type Event v1beta1.Event

type ObjectLineage

type ObjectLineage map[int]Spec

for example a postgres

func (ObjectLineage) Bisect

func (o ObjectLineage) Bisect(argMap map[string]string) string

Outer loop is going through each of the versions in order. First I parse the query into a slice of field/value pairs. Then build the map of related fields that belong to the same top level attribute and need to be found in the same underlying map. Then I looped over the field value pairs, searched based on the type.

func (ObjectLineage) FieldDiff

func (o ObjectLineage) FieldDiff(fieldName string, vNumStart, vNumEnd int) string

func (ObjectLineage) FullDiff

func (o ObjectLineage) FullDiff(vNumStart, vNumEnd int) string

func (ObjectLineage) GetVersions

func (o ObjectLineage) GetVersions() string

func (ObjectLineage) SpecHistory

func (o ObjectLineage) SpecHistory() string

func (ObjectLineage) SpecHistoryInterval

func (o ObjectLineage) SpecHistoryInterval(vNumStart, vNumEnd int) string

func (ObjectLineage) String

func (o ObjectLineage) String() string

Returns the string representation of ObjectLineage used in GetHistory

type OrderedMap

type OrderedMap []pair

func (OrderedMap) At

func (o OrderedMap) At(attrib string) (interface{}, bool)

Similar to a map access .. returns Data, ok

type ProvenanceOfObject

type ProvenanceOfObject struct {
	ObjectFullHistory ObjectLineage
	ResourcePlural    string
	Name              string
}

func FindProvenanceObjectByName

func FindProvenanceObjectByName(name string, allObjects []ProvenanceOfObject) *ProvenanceOfObject

func NewProvenanceOfObject

func NewProvenanceOfObject() *ProvenanceOfObject

type Spec

type Spec struct {
	AttributeToData map[string]interface{}
	Version         int
	Timestamp       string
}

func NewSpec

func NewSpec() *Spec

func (Spec) OrderedPairs

func (s Spec) OrderedPairs() OrderedMap

Need some way to bring order to the elements of the AttributeToData map, because otherwise, the output is randomly ordered and I cannot unit test that. so This method orders the map based on the Attribute key and is similar to C++'s pair.

func (*Spec) String

func (s *Spec) String() string

This String function must return the same output upon different calls. So I am doing ordering and sorting here because map is unordered and gives random outputs when printing

Jump to

Keyboard shortcuts

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