util

package
v1.39.18 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOneOfField added in v0.27.0

func IsOneOfField(field reflect.StructField) bool

IsOneOfField checks if a field is tagged with oneOf

func UnmarshalClusterVolumes added in v1.18.0

func UnmarshalClusterVolumes(value *yaml.Node) (volumes []v1.Volume, remaining []byte, result error)

UnmarshalClusterVolumes provides a helper function to for a custom unmarshler to deal with https://github.com/GoogleContainerTools/skaffold/issues/4175

func UnmarshalKanikoArtifact added in v1.18.0

func UnmarshalKanikoArtifact(value *yaml.Node) (mounts []v1.VolumeMount, remaining []byte, result error)

UnmarshalKanikoArtifact provides a helper function to for a custom unmarshaller to deal with https://github.com/GoogleContainerTools/skaffold/issues/4175

func UpgradePipelines added in v0.37.0

func UpgradePipelines(oldConfig, newConfig interface{}, upgrade func(o, n interface{}) error) (err error)

Types

type FlatMap added in v1.7.1

type FlatMap map[string]string

FlatMap flattens deeply nested yaml into a map with corresponding dot separated keys

func (*FlatMap) UnmarshalYAML added in v1.7.1

func (m *FlatMap) UnmarshalYAML(unmarshal func(interface{}) error) error

type HelmOverrides added in v0.25.0

type HelmOverrides struct {
	Values map[string]interface{} `yaml:",inline"`
}

HelmOverrides is a helper struct to aid with json serialization of map[string]interface{}

func (*HelmOverrides) MarshalJSON added in v0.25.0

func (h *HelmOverrides) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON marshalling by including the value as an inline yaml fragment.

func (*HelmOverrides) UnmarshalJSON added in v0.25.0

func (h *HelmOverrides) UnmarshalJSON(text []byte) error

UnmarshalYAML implements JSON unmarshalling by reading an inline yaml fragment.

type IntOrString added in v1.7.1

type IntOrString struct {
	Type   Type
	IntVal int
	StrVal string
}

func FromInt added in v1.7.1

func FromInt(val int) IntOrString

FromInt creates an IntOrString object with an int32 value.

func FromString added in v1.7.1

func FromString(val string) IntOrString

FromString creates an IntOrString object with a string value.

func (IntOrString) MarshalJSON added in v1.7.1

func (t IntOrString) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (IntOrString) MarshalYAML added in v1.7.1

func (t IntOrString) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*IntOrString) String added in v1.7.1

func (t *IntOrString) String() string

String returns the string value, or the Itoa of the int value.

func (*IntOrString) UnmarshalJSON added in v1.7.1

func (t *IntOrString) UnmarshalJSON(value []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*IntOrString) UnmarshalYAML added in v1.7.1

func (t *IntOrString) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Type added in v1.7.1

type Type int
const (
	Int    Type = iota // The IntOrString holds an int.
	String             // The IntOrString holds a string.
)

type VersionedConfig

type VersionedConfig interface {
	GetVersion() string
	Upgrade() (VersionedConfig, error)
}

type YamlpatchNode added in v0.28.0

type YamlpatchNode struct {
	// node is an arbitrary yaml fragment
	Node yamlpatch.Node
}

YamlpatchNode wraps a `yamlpatch.Node` and makes it serializable to JSON. The yaml serialization needs to be implemented manually, because the node may be an arbitrary yaml fragment so that a field tag `yaml:",inline"` does not work here.

func (*YamlpatchNode) MarshalJSON added in v0.28.0

func (n *YamlpatchNode) MarshalJSON() ([]byte, error)

MarshalJSON implements JSON marshalling by including the value as an inline yaml fragment.

func (*YamlpatchNode) MarshalYAML added in v0.28.0

func (n *YamlpatchNode) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*YamlpatchNode) UnmarshalJSON added in v0.28.0

func (n *YamlpatchNode) UnmarshalJSON(text []byte) error

UnmarshalYAML implements JSON unmarshalling by reading an inline yaml fragment.

func (*YamlpatchNode) UnmarshalYAML added in v0.28.0

func (n *YamlpatchNode) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler

Jump to

Keyboard shortcuts

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