helpers

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Create                            = "create"
	Read                              = "read"
	Update                            = "update"
	Delete                            = "delete"
	List                              = "list"
	ClientError                       = "Client Error"
	ResourceError                     = "Resource Error"
	DataSourceError                   = "Data Source Error"
	UnexpectedImportIdentifier        = "Unexpected Import Identifier"
	UnexpectedResourceConfigureType   = "Unexpected Resource Configure Type"
	UnexpectedDataSourceConfigureType = "Unexpected DataSource Configure Type"
)

define constant for error management.

View Source
const SensitiveValue = "********"

Variables

This section is empty.

Functions

func DataSourceConfigure added in v1.5.0

DataSourceConfigure is a helper function to set the client for a specific data source.

func ImportStatePassthroughIntID added in v1.5.0

func ImportStatePassthroughIntID(ctx context.Context, attrPath path.Path, req resource.ImportStateRequest, resp *resource.ImportStateResponse)

ImportStatePassthroughIntID is a helper function to set the import identifier to a given state attribute path. The attribute must accept a int value. extends https://github.com/hashicorp/terraform-plugin-framework/blob/main/resource/import_state.go.

func ParseClientError added in v1.5.0

func ParseClientError(action, name string, err error) string

func ParseNotFoundError added in v1.10.0

func ParseNotFoundError(kind, field, search string) string

func ReadFields added in v1.5.1

func ReadFields(ctx context.Context, fieldContainer interface{}, fieldLists Fields) []*lidarr.Field

ReadFields takes in input a field container and populates a lidarr.Field slice.

func ResourceConfigure added in v1.5.0

ResourceConfigure is a helper function to set the client for a specific resource.

func WriteFields added in v1.5.1

func WriteFields(ctx context.Context, fieldContainer interface{}, fields []*lidarr.Field, fieldLists Fields)

WriteFields takes in input a lidarr.Field slice and populate the relevant container fields.

Types

type Fields added in v1.5.1

type Fields struct {
	Bools                  []string
	BoolsExceptions        []string
	Ints                   []string
	IntsExceptions         []string
	Strings                []string
	StringsExceptions      []string
	Floats                 []string
	FloatsExceptions       []string
	IntSlices              []string
	IntSlicesExceptions    []string
	StringSlices           []string
	StringSlicesExceptions []string
}

Fields contains all the field lists of a specific resource per type.

Jump to

Keyboard shortcuts

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