Documentation
¶
Index ¶
- func DiagnosticsToString(diags diag.Diagnostics) string
- func DynamicAttrValueToGo(ctx context.Context, v attr.Value) (interface{}, diag.Diagnostics)
- func DynamicToJSONString(ctx context.Context, dynamicValue types.Dynamic) (string, diag.Diagnostics)
- func FlattenRecursive(ctx context.Context, prefix string, data interface{}, ...)
- func GenerateKeysFromResponse(ctx context.Context, responseBytes []byte) (map[string]interface{}, error)
- func GetMapKeys(m map[string]interface{}) []string
- func JSONEqual(json1, json2 string) (bool, error)
- func MapToJSONString(ctx context.Context, mapValue types.Map) (string, diag.Diagnostics)
- func NormalizeJSONForComparison(jsonStr string) (string, error)
- func ParseGraphQLQueryFields(query string) []string
- type ResponseExtraction
- func (re *ResponseExtraction) ExtractCurrentStateFromQueryResponse(ctx context.Context, queryResponse map[string]interface{}) map[string]interface{}
- func (re *ResponseExtraction) ExtractValueFromPath(data map[string]interface{}, path string) (interface{}, error)
- func (re *ResponseExtraction) IsValidResourceData(data map[string]interface{}) bool
- type StateComparison
- func (sc *StateComparison) DetectFieldChanges(ctx context.Context, desiredState map[string]interface{}, ...) bool
- func (sc *StateComparison) ExtractCurrentStateFromQueryResponse(ctx context.Context, queryResponse map[string]interface{}) map[string]interface{}
- func (sc *StateComparison) FindChangedFields(ctx context.Context, current, previous map[string]interface{}) map[string]interface{}
- func (sc *StateComparison) HasConfigurationChanges(ctx context.Context, data interface{}) bool
- func (sc *StateComparison) ValuesEqual(desired, current interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiagnosticsToString ¶
func DiagnosticsToString(diags diag.Diagnostics) string
DiagnosticsToString converts diagnostics to a string for logging
func DynamicAttrValueToGo ¶
DynamicAttrValueToGo recursively converts attr.Value to Go values for JSON serialization
func DynamicToJSONString ¶
func DynamicToJSONString(ctx context.Context, dynamicValue types.Dynamic) (string, diag.Diagnostics)
DynamicToJSONString converts a types.Dynamic to a JSON string
func FlattenRecursive ¶
func FlattenRecursive(ctx context.Context, prefix string, data interface{}, keyMap map[string]interface{})
FlattenRecursive flattens nested JSON structures into dot-notation keys
func GenerateKeysFromResponse ¶
func GenerateKeysFromResponse(ctx context.Context, responseBytes []byte) (map[string]interface{}, error)
GenerateKeysFromResponse extracts keys from a GraphQL response
func GetMapKeys ¶
GetMapKeys returns the keys of a map as a slice of strings
func MapToJSONString ¶
MapToJSONString converts a types.Map to a JSON string
func NormalizeJSONForComparison ¶
NormalizeJSONForComparison normalizes JSON by marshaling and unmarshaling to ensure consistent field ordering
func ParseGraphQLQueryFields ¶
ParseGraphQLQueryFields extracts field names from a GraphQL query
Types ¶
type ResponseExtraction ¶
type ResponseExtraction struct{}
ResponseExtraction provides utilities for extracting data from GraphQL responses
func (*ResponseExtraction) ExtractCurrentStateFromQueryResponse ¶
func (re *ResponseExtraction) ExtractCurrentStateFromQueryResponse(ctx context.Context, queryResponse map[string]interface{}) map[string]interface{}
ExtractCurrentStateFromQueryResponse intelligently extracts the current state from a GraphQL query response using heuristics to determine the best data source
func (*ResponseExtraction) ExtractValueFromPath ¶
func (re *ResponseExtraction) ExtractValueFromPath(data map[string]interface{}, path string) (interface{}, error)
ExtractValueFromPath extracts a value from a nested map using a dot-separated path
func (*ResponseExtraction) IsValidResourceData ¶
func (re *ResponseExtraction) IsValidResourceData(data map[string]interface{}) bool
IsValidResourceData checks if the given data looks like a valid resource
type StateComparison ¶
type StateComparison struct{}
StateComparison provides utilities for comparing Terraform state
func NewStateComparison ¶
func NewStateComparison() *StateComparison
NewStateComparison creates a new StateComparison instance
func (*StateComparison) DetectFieldChanges ¶
func (sc *StateComparison) DetectFieldChanges(ctx context.Context, desiredState map[string]interface{}, currentStateData interface{}) bool
DetectFieldChanges compares the desired state with the current platform state to determine if there are actual changes that need to be applied
func (*StateComparison) ExtractCurrentStateFromQueryResponse ¶
func (sc *StateComparison) ExtractCurrentStateFromQueryResponse(ctx context.Context, queryResponse map[string]interface{}) map[string]interface{}
ExtractCurrentStateFromQueryResponse extracts current state from a GraphQL query response
func (*StateComparison) FindChangedFields ¶
func (sc *StateComparison) FindChangedFields(ctx context.Context, current, previous map[string]interface{}) map[string]interface{}
FindChangedFields finds the fields that have changed between two states
func (*StateComparison) HasConfigurationChanges ¶
func (sc *StateComparison) HasConfigurationChanges(ctx context.Context, data interface{}) bool
HasConfigurationChanges checks if there are configuration changes in the data model
func (*StateComparison) ValuesEqual ¶
func (sc *StateComparison) ValuesEqual(desired, current interface{}) bool
ValuesEqual compares two values for equality, handling different types