yaml

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitMultiDocumentYAML

func SplitMultiDocumentYAML(multidoc string) (documents []string, err error)

Types

type Manifest

type Manifest struct {
	Raw *meta_v1_unstruct.Unstructured
}

func NewFromUnstructured

func NewFromUnstructured(raw *meta_v1_unstruct.Unstructured) *Manifest

func ParseYAML

func ParseYAML(yaml string) (*Manifest, error)

ParseYAML parses a yaml string into an Manifest.

To make things play nice we need the JSON representation of the object as the `RawObj` 1. UnMarshal YAML into map 2. Marshal map into JSON 3. UnMarshal JSON into the Unstructured type so we get some K8s checking

func (*Manifest) AsYAML

func (m *Manifest) AsYAML() (string, error)

AsYAML will produce a yaml representation of the manifest. We do this by serializing to json and back again to ensure values and comments are cleansed

func (*Manifest) GetAPIVersion

func (m *Manifest) GetAPIVersion() string

func (*Manifest) GetKind

func (m *Manifest) GetKind() string

func (*Manifest) GetName

func (m *Manifest) GetName() string

func (*Manifest) GetNamespace

func (m *Manifest) GetNamespace() string
func (m *Manifest) GetSelfLink() string

func (*Manifest) GetUID

func (m *Manifest) GetUID() string

func (*Manifest) HasNamespace

func (m *Manifest) HasNamespace() bool

func (*Manifest) SetNamespace

func (m *Manifest) SetNamespace(namespace string)

func (*Manifest) String

func (m *Manifest) String() string

Jump to

Keyboard shortcuts

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