doc

package
v0.0.0-...-32be1cf Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixKustomizationPreUnmarshallingNonFatal

func FixKustomizationPreUnmarshallingNonFatal(data []byte) ([]byte, error)

Types

type Document

type Document struct {
	RepositoryURL string     `json:"repositoryUrl,omitempty"`
	FilePath      string     `json:"filePath,omitempty"`
	DefaultBranch string     `json:"defaultBranch,omitempty"`
	DocumentData  string     `json:"document,omitempty"`
	CreationTime  *time.Time `json:"creationTime,omitempty"`
	IsSame        bool       `json:"-"`
}

func (*Document) FromRelativePath

func (doc *Document) FromRelativePath(newFile string) (Document, error)

func (*Document) GetDocument

func (doc *Document) GetDocument() *Document

Implements the CrawlerDocument interface.

func (*Document) ID

func (doc *Document) ID() string

func (*Document) WasCached

func (doc *Document) WasCached() bool

Implements the CrawlerDocument interface.

type KustomizationDocument

type KustomizationDocument struct {
	Document
	Kinds       []string `json:"kinds,omitempty"`
	Identifiers []string `json:"identifiers,omitempty"`
	Values      []string `json:"values,omitempty"`
}

This document is meant to be used at the elasticsearch document type. Fields are serialized as-is to elasticsearch, where indices are built to facilitate text search queries. Identifiers, Values, FilePath, RepositoryURL and DocumentData are meant to be searched for text queries directly, while the other fields can either be used as a filter, or as additional metadata displayed in the UI.

The fields of the document and their purpose are listed below:

  • DocumentData contains the contents of the kustomization file.
  • Kinds Represents the kubernetes Kinds that are in this file.
  • Identifiers are a list of (partial and full) identifier paths that can be found by users. Each part of a path is delimited by ":" e.g. spec:replicas.
  • Values are a list of identifier paths and their values that can be found by search queries. The path is delimited by ":" and the value follows the "=" symbol e.g. spec:replicas=4.
  • FilePath is the path of the file.
  • RepositoryURL is the URL of the source repository.
  • CreationTime is the time at which the file was created.

Representing each Identifier and Value as a flat string representation facilitates the use of complex text search features from elasticsearch such as fuzzy searching, regex, wildcards, etc.

func (*KustomizationDocument) GetResources

func (doc *KustomizationDocument) GetResources() ([]*Document, error)

Implements the CrawlerDocument interface.

func (*KustomizationDocument) ParseYAML

func (doc *KustomizationDocument) ParseYAML() error

Jump to

Keyboard shortcuts

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