utils

package
v0.47.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUpToDate

func IsUpToDate(actual, desired interface{}, opts ...LateInitOption) (bool, string, error)

IsUpToDate checks whether the actual state is up-to-date with the given desired state

func LateInitializeFromResponse

func LateInitializeFromResponse(parentName string, crObject interface{}, responseObject interface{},
	opts ...LateInitOption) (bool, error)

LateInitializeFromResponse Copy unset (nil) values from responseObject to crObject Both crObject and responseObject must be pointers to structs. Otherwise, an error will be returned. Returns `true` if at least one field has been stored from source `responseObject` into a corresponding field of target `crObject`.

Types

type LateInitOption

type LateInitOption interface {
	// contains filtered or unexported methods
}

LateInitOption Interface for options that affect late-initialization behavior of a managed resource

type NameMapper

type NameMapper func(string) string

NameMapper defines a transformation from CR field names to response field names

func MapReplacer

func MapReplacer(m map[string]string) NameMapper

MapReplacer returns a `NameMapper` as a `LateInitOption` that uses the specified `map[string]string` to map from target CR field names to corresponding source response field names.

func Replacer

func Replacer(old, new string) NameMapper

Replacer returns a `NameMapper` as a `LateInitOption` that that replaces all occurrences of string `old` to `new` in a target CR field name to obtain the corresponding source response field name.

Jump to

Keyboard shortcuts

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