istio: istio.io/istio/pkg/test/util/yml Index | Files

package yml

import "istio.io/istio/pkg/test/util/yml"

Index

Package Files

apply.go cache.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.

func JoinString Uses

func JoinString(parts ...string) string

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

func SplitString Uses

func SplitString(yamlText string) []string

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

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 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 10 packages (graph) and is imported by 6 packages. Updated 2019-05-21. Refresh now. Tools for package owners.