istio: Index | Files

package yml

import ""


Package Files

apply.go cache.go file.go parse.go parts.go

func ApplyNamespace Uses

func ApplyNamespace(yamlText, ns string) (string, error)

ApplyNamespace applies the given namespaces to the resources in the yamlText if not set.

func JoinString Uses

func JoinString(parts ...string) string

JoinString joins the given yaml parts into a single multipart document.

func MustApplyNamespace Uses

func MustApplyNamespace(t test.Failer, yamlText, ns string) string

MustApplyNamespace applies the given namespaces to the resources in the yamlText if not set.

func SplitString Uses

func SplitString(yamlText string) []string

SplitString splits the given yaml doc if it's multipart document.

func SplitYamlByKind Uses

func SplitYamlByKind(content string) map[string]string

SplitYamlByKind splits the given YAML into parts indexed by kind.

type Cache Uses

type Cache struct {
    // contains filtered or unexported fields

Cache tracks the life-cycle of Yaml based resources. It stores single-part Yaml files on disk and updates the files as needed, as the resources change.

func NewCache Uses

func NewCache(dir string) *Cache

NewCache returns a new Cache instance

func (*Cache) AllKeys Uses

func (c *Cache) AllKeys() []CacheKey

AllKeys returns all resource keys in the tracker.

func (*Cache) Apply Uses

func (c *Cache) Apply(yamlText string) ([]CacheKey, error)

Apply adds the given yamlText contents as part of a given context name. If there is an existing context with the given name, then a diffgram will be generated.

func (*Cache) Clear Uses

func (c *Cache) Clear() error

Clear all tracked yaml content.

func (*Cache) Delete Uses

func (c *Cache) Delete(yamlText string) error

Delete the resources from the given yamlText

func (*Cache) GetFileFor Uses

func (c *Cache) GetFileFor(k CacheKey) string

GetFileFor returns the file that keeps the on-disk state for the given key.

type CacheKey Uses

type CacheKey struct {
    // contains filtered or unexported fields

CacheKey is a key representing a tracked Yaml based resource.

type Descriptor Uses

type Descriptor struct {
    Kind       string   `json:"kind"`
    Group      string   `json:"group"`
    APIVersion string   `json:"apiVersion"`
    Metadata   Metadata `json:"metadata"`

Descriptor a descriptor for a kubernetes resource.

func ParseDescriptor Uses

func ParseDescriptor(yamlText string) (Descriptor, error)

ParseDescriptor parses the given single-part yaml and generates the descriptor.

type FileWriter Uses

type FileWriter interface {
    // WriteYAML writes the given YAML content to one or more YAML files.
    WriteYAML(filenamePrefix string, contents ...string) ([]string, error)

    // WriteYAMLOrFail calls WriteYAML and fails the test if an error occurs.
    WriteYAMLOrFail(t test.Failer, filenamePrefix string, contents ...string) []string

FileWriter write YAML content to files.

func NewFileWriter Uses

func NewFileWriter(workDir string) FileWriter

NewFileWriter creates a new FileWriter that stores files under workDir.

type Metadata Uses

type Metadata struct {
    Name      string `json:"name"`
    Namespace string `json:"namespace"`

Metadata metadata for a kubernetes resource.

type Part Uses

type Part struct {
    Contents   string
    Descriptor Descriptor

Part is a single-part yaml source, along with its descriptor.

func Parse Uses

func Parse(yamlText string) ([]Part, error)

Parse parses the given multi-part yaml text, and returns as Parts.

Package yml imports 12 packages (graph) and is imported by 7 packages. Updated 2021-01-14. Refresh now. Tools for package owners.