{"modulePath":"github.com/kptdev/kpt/api","version":"v1.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package node\n\nPackage node is the YAML node model behind KubeObject. It preserves formatting while reading and writing maps, slices, and scalars.\n\n## Variables\n\n```go\nvar PrecomputedIsNamespaceScoped = map[yaml.TypeMeta]bool{\n\t{APIVersion: \"admissionregistration.k8s.io/v1\", Kind: \"MutatingWebhookConfiguration\"}:        false,\n\t{APIVersion: \"admissionregistration.k8s.io/v1\", Kind: \"ValidatingWebhookConfiguration\"}:      false,\n\t{APIVersion: \"admissionregistration.k8s.io/v1beta1\", Kind: \"MutatingWebhookConfiguration\"}:   false,\n\t{APIVersion: \"admissionregistration.k8s.io/v1beta1\", Kind: \"ValidatingWebhookConfiguration\"}: false,\n\t{APIVersion: \"apiextensions.k8s.io/v1\", Kind: \"CustomResourceDefinition\"}:                    false,\n\t{APIVersion: \"apiextensions.k8s.io/v1beta1\", Kind: \"CustomResourceDefinition\"}:               false,\n\t{APIVersion: \"apiregistration.k8s.io/v1\", Kind: \"APIService\"}:                                false,\n\t{APIVersion: \"apiregistration.k8s.io/v1beta1\", Kind: \"APIService\"}:                           false,\n\t{APIVersion: \"apps/v1\", Kind: \"ControllerRevision\"}:                                          true,\n\t{APIVersion: \"apps/v1\", Kind: \"DaemonSet\"}:                                                   true,\n\t{APIVersion: \"apps/v1\", Kind: \"Deployment\"}:                                                  true,\n\t{APIVersion: \"apps/v1\", Kind: \"ReplicaSet\"}:                                                  true,\n\t{APIVersion: \"apps/v1\", Kind: \"StatefulSet\"}:                                                 true,\n\t{APIVersion: \"autoscaling/v1\", Kind: \"HorizontalPodAutoscaler\"}:                              true,\n\t{APIVersion: \"autoscaling/v1\", Kind: \"Scale\"}:                                                true,\n\t{APIVersion: \"autoscaling/v2beta1\", Kind: \"HorizontalPodAutoscaler\"}:                         true,\n\t{APIVersion: \"autoscaling/v2beta2\", Kind: \"HorizontalPodAutoscaler\"}:                         true,\n\t{APIVersion: \"batch/v1\", Kind: \"CronJob\"}:                                                    true,\n\t{APIVersion: \"batch/v1\", Kind: \"Job\"}:                                                        true,\n\t{APIVersion: \"batch/v1beta1\", Kind: \"CronJob\"}:                                               true,\n\t{APIVersion: \"certificates.k8s.io/v1\", Kind: \"CertificateSigningRequest\"}:                    false,\n\t{APIVersion: \"certificates.k8s.io/v1beta1\", Kind: \"CertificateSigningRequest\"}:               false,\n\t{APIVersion: \"coordination.k8s.io/v1\", Kind: \"Lease\"}:                                        true,\n\t{APIVersion: \"coordination.k8s.io/v1beta1\", Kind: \"Lease\"}:                                   true,\n\t{APIVersion: \"discovery.k8s.io/v1\", Kind: \"EndpointSlice\"}:                                   true,\n\t{APIVersion: \"discovery.k8s.io/v1beta1\", Kind: \"EndpointSlice\"}:                              true,\n\t{APIVersion: \"events.k8s.io/v1\", Kind: \"Event\"}:                                              true,\n\t{APIVersion: \"events.k8s.io/v1beta1\", Kind: \"Event\"}:                                         true,\n\t{APIVersion: \"extensions/v1beta1\", Kind: \"Ingress\"}:                                          true,\n\t{APIVersion: \"flowcontrol.apiserver.k8s.io/v1beta1\", Kind: \"FlowSchema\"}:                     false,\n\t{APIVersion: \"flowcontrol.apiserver.k8s.io/v1beta1\", Kind: \"PriorityLevelConfiguration\"}:     false,\n\t{APIVersion: \"networking.k8s.io/v1\", Kind: \"Ingress\"}:                                        true,\n\t{APIVersion: \"networking.k8s.io/v1\", Kind: \"IngressClass\"}:                                   false,\n\t{APIVersion: \"networking.k8s.io/v1\", Kind: \"NetworkPolicy\"}:                                  true,\n\t{APIVersion: \"networking.k8s.io/v1beta1\", Kind: \"Ingress\"}:                                   true,\n\t{APIVersion: \"networking.k8s.io/v1beta1\", Kind: \"IngressClass\"}:                              false,\n\t{APIVersion: \"node.k8s.io/v1\", Kind: \"RuntimeClass\"}:                                         false,\n\t{APIVersion: \"node.k8s.io/v1beta1\", Kind: \"RuntimeClass\"}:                                    false,\n\t{APIVersion: \"policy/v1\", Kind: \"PodDisruptionBudget\"}:                                       true,\n\t{APIVersion: \"policy/v1beta1\", Kind: \"PodDisruptionBudget\"}:                                  true,\n\t{APIVersion: \"policy/v1beta1\", Kind: \"PodSecurityPolicy\"}:                                    false,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1\", Kind: \"ClusterRole\"}:                            false,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1\", Kind: \"ClusterRoleBinding\"}:                     false,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1\", Kind: \"Role\"}:                                   true,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1\", Kind: \"RoleBinding\"}:                            true,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1beta1\", Kind: \"ClusterRole\"}:                       false,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1beta1\", Kind: \"ClusterRoleBinding\"}:                false,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1beta1\", Kind: \"Role\"}:                              true,\n\t{APIVersion: \"rbac.authorization.k8s.io/v1beta1\", Kind: \"RoleBinding\"}:                       true,\n\t{APIVersion: \"scheduling.k8s.io/v1\", Kind: \"PriorityClass\"}:                                  false,\n\t{APIVersion: \"scheduling.k8s.io/v1beta1\", Kind: \"PriorityClass\"}:                             false,\n\t{APIVersion: \"storage.k8s.io/v1\", Kind: \"CSIDriver\"}:                                         false,\n\t{APIVersion: \"storage.k8s.io/v1\", Kind: \"CSINode\"}:                                           false,\n\t{APIVersion: \"storage.k8s.io/v1\", Kind: \"StorageClass\"}:                                      false,\n\t{APIVersion: \"storage.k8s.io/v1\", Kind: \"VolumeAttachment\"}:                                  false,\n\t{APIVersion: \"storage.k8s.io/v1beta1\", Kind: \"CSIDriver\"}:                                    false,\n\t{APIVersion: \"storage.k8s.io/v1beta1\", Kind: \"CSINode\"}:                                      false,\n\t{APIVersion: \"storage.k8s.io/v1beta1\", Kind: \"CSIStorageCapacity\"}:                           true,\n\t{APIVersion: \"storage.k8s.io/v1beta1\", Kind: \"StorageClass\"}:                                 false,\n\t{APIVersion: \"storage.k8s.io/v1beta1\", Kind: \"VolumeAttachment\"}:                             false,\n\t{APIVersion: \"v1\", Kind: \"ComponentStatus\"}:                                                  false,\n\t{APIVersion: \"v1\", Kind: \"ConfigMap\"}:                                                        true,\n\t{APIVersion: \"v1\", Kind: \"Endpoints\"}:                                                        true,\n\t{APIVersion: \"v1\", Kind: \"Event\"}:                                                            true,\n\t{APIVersion: \"v1\", Kind: \"LimitRange\"}:                                                       true,\n\t{APIVersion: \"v1\", Kind: \"Namespace\"}:                                                        false,\n\t{APIVersion: \"v1\", Kind: \"Node\"}:                                                             false,\n\t{APIVersion: \"v1\", Kind: \"NodeProxyOptions\"}:                                                 false,\n\t{APIVersion: \"v1\", Kind: \"PersistentVolume\"}:                                                 false,\n\t{APIVersion: \"v1\", Kind: \"PersistentVolumeClaim\"}:                                            true,\n\t{APIVersion: \"v1\", Kind: \"Pod\"}:                                                              true,\n\t{APIVersion: \"v1\", Kind: \"PodAttachOptions\"}:                                                 true,\n\t{APIVersion: \"v1\", Kind: \"PodExecOptions\"}:                                                   true,\n\t{APIVersion: \"v1\", Kind: \"PodPortForwardOptions\"}:                                            true,\n\t{APIVersion: \"v1\", Kind: \"PodProxyOptions\"}:                                                  true,\n\t{APIVersion: \"v1\", Kind: \"PodTemplate\"}:                                                      true,\n\t{APIVersion: \"v1\", Kind: \"ReplicationController\"}:                                            true,\n\t{APIVersion: \"v1\", Kind: \"ResourceQuota\"}:                                                    true,\n\t{APIVersion: \"v1\", Kind: \"Secret\"}:                                                           true,\n\t{APIVersion: \"v1\", Kind: \"Service\"}:                                                          true,\n\t{APIVersion: \"v1\", Kind: \"ServiceAccount\"}:                                                   true,\n\t{APIVersion: \"v1\", Kind: \"ServiceProxyOptions\"}:                                              true,\n}\n```\nPrecomputedIsNamespaceScoped copies the sigs.k8s.io/kustomize/kyaml/openapi precomputedIsNamespaceScoped\n\n## Functions\n\n```go\nfunc MapVariantToTypedObject(mv *MapVariant, ptr any) error\n```\n\n```go\nfunc NewDoc(nodes ...*yaml.Node) *doc\n```\n\n```go\nfunc ParseDoc(b []byte) (*doc, error)\n```\n\n## Types\n\n```go\ntype MapVariant struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ExtractObjects(nodes ...*yaml.Node) ([]*MapVariant, error)\n```\n\n```go\nfunc NewMap(node *yaml.Node) *MapVariant\n```\n\n```go\nfunc NewStringMapVariant(m map[string]string) *MapVariant\n```\n\n```go\nfunc TypedObjectToMapVariant(v any) (*MapVariant, error)\n```\n\n```go\nfunc (o *MapVariant) Entries() (map[string]variant, error)\n```\n\n```go\nfunc (o *MapVariant) GetKind() VariantKind\n```\n\n```go\nfunc (o *MapVariant) GetMap(field string) *MapVariant\n```\nGetMap will return the field as a map if it exists and is a map, otherwise it will return nil. Note that if the value exists but is not a map, nil will be returned.\n\n```go\nfunc (o *MapVariant) GetNestedBool(fields ...string) (bool, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedFloat(fields ...string) (float64, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedInt(fields ...string) (int, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedMap(fields ...string) (*MapVariant, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedScalar(fields ...string) (*scalarVariant, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedSlice(fields ...string) (*SliceVariant, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedString(fields ...string) (string, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedStringMap(fields ...string) (map[string]string, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetNestedValue(fields ...string) (variant, bool, error)\n```\n\n```go\nfunc (o *MapVariant) GetRNode(fields ...string) (*yaml.RNode, bool, error)\n```\n\n```go\nfunc (o *MapVariant) HasKey(key string) bool\n```\n\n```go\nfunc (o *MapVariant) IsEmpty() bool\n```\n\n```go\nfunc (o *MapVariant) Node() *yaml.Node\n```\n\n```go\nfunc (o *MapVariant) RemoveNestedField(fields ...string) (bool, error)\n```\n\n```go\nfunc (o *MapVariant) Set(newValue *MapVariant)\n```\n\n```go\nfunc (o *MapVariant) SetNestedBool(b bool, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedFloat(f float64, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedInt(i int, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedMap(m *MapVariant, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedSlice(s *SliceVariant, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedString(s string, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedStringMap(m map[string]string, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) SetNestedValue(val variant, fields ...string) error\n```\n\n```go\nfunc (o *MapVariant) UpsertMap(field string) *MapVariant\n```\nUpsertMap will return the field as a map if it exists and is a map, otherwise it will insert a map at the specified field. Note that if the value exists but is not a map, it will be replaced with a map.\n\n```go\ntype SliceVariant struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSliceVariant(s ...variant) *SliceVariant\n```\n\n```go\nfunc TypedObjectToSliceVariant(v any) (*SliceVariant, error)\n```\n\n```go\nfunc (v *SliceVariant) Add(node variant)\n```\n\n```go\nfunc (v *SliceVariant) Clear()\n```\n\n```go\nfunc (v *SliceVariant) Elements() ([]*MapVariant, error)\n```\n\n```go\nfunc (v *SliceVariant) GetKind() VariantKind\n```\n\n```go\nfunc (v *SliceVariant) Node() *yaml.Node\n```\n\n```go\ntype VariantKind string\n```\n\n```go\nconst (\n\tVariantKindMap    VariantKind = \"Map\"\n\tVariantKindSlice  VariantKind = \"Slice\"\n\tVariantKindScalar VariantKind = \"Scalar\"\n)\n```\n\n","path":"github.com/kptdev/kpt/api/kubeobject/node","name":"node","synopsis":"Package node is the YAML node model behind KubeObject.","isRedistributable":true}
