utils

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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