utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utils provides utility functions for the AWX package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtoiDefault

func AtoiDefault(s string, defaultValue *int) *int

AtoiDefault takes a string and a defaultValue. If the string cannot be converted, defaultValue is returned.

func DiagCreate added in v1.0.5

func DiagCreate(method string, err error) diag.Diagnostics

DiagCreate : Return the message for the create method

func DiagDelete added in v1.0.5

func DiagDelete(method string, id interface{}, err error) diag.Diagnostics

DiagDelete : Return the message for the delete method

func DiagFetch added in v1.0.5

func DiagFetch(method string, id interface{}, err error) diag.Diagnostics

DiagFetch : Return the message for the fetch method

func DiagNotFound added in v1.0.5

func DiagNotFound(method string, id interface{}, err error) diag.Diagnostics

DiagNotFound : Return the message for the not found method

func DiagUpdate added in v1.0.5

func DiagUpdate(method string, id interface{}, err error) diag.Diagnostics

DiagUpdate : Return the message for the update method

func Diagf added in v1.0.5

func Diagf(diagSummary, diagDetails string, detailsVars ...interface{}) diag.Diagnostics

Diagf : Return the message for the diag method

func MarshalYAML added in v1.0.5

func MarshalYAML(v interface{}) string

MarshalYAML : Marshal the interface{} to YAML string

func Normalize added in v1.0.5

func Normalize(s interface{}) string

Normalize : normalize the input data of type interface{} to string of either JSON or YAML

func NormalizeJSONOk added in v1.0.5

func NormalizeJSONOk(s interface{}) (string, bool)

NormalizeJSONOk : normalize the input data of type interface{} to string of JSON

func NormalizeYamlOk added in v1.0.5

func NormalizeYamlOk(s interface{}) (string, bool)

NormalizeYamlOk : normalize the input data of type interface{} to string of YAML

func StateIDToInt added in v1.0.5

func StateIDToInt(tfElement string, d *schema.ResourceData) (int, diag.Diagnostics)

StateIDToInt : Convert the ID from the state to an integer

func UnmarshalYAML added in v1.0.5

func UnmarshalYAML(str string) map[string]interface{}

UnmarshalYAML : Unmarshal the YAML string to map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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