schema

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dictionary

type Dictionary struct {
	// contains filtered or unexported fields
}

Dictionary is a map which defines ImportIDFunc for each resource type.

func NewDictionary

func NewDictionary() *Dictionary

NewDictionary returns a new instance of Dictionary.

func (*Dictionary) ImportID

func (d *Dictionary) ImportID(resourceType string, r Resource) (string, error)

ImportID calculates an import ID from a given resource.

func (*Dictionary) RegisterImportIDFunc

func (d *Dictionary) RegisterImportIDFunc(resourceType string, f ImportIDFunc)

RegisterImportIDFunc registers an ImportIDFunc for a given resource type.

func (*Dictionary) RegisterImportIDFuncMap

func (d *Dictionary) RegisterImportIDFuncMap(importIDFuncMap map[string]ImportIDFunc)

RegisterImportIDFuncMap is a helper method to register a map of ImportIDFunc.

type ImportIDFunc

type ImportIDFunc func(r Resource) (string, error)

ImportIDFunc is a type of function which calculates an import ID from a given resource.

func ImportIDFuncByAttribute

func ImportIDFuncByAttribute(key string) ImportIDFunc

ImportIDFuncByAttribute is a helper method to define an ImportIDFunc which simply uses a specific single attribute as an import ID.

func ImportIDFuncByMultiAttributes

func ImportIDFuncByMultiAttributes(keys []string, sep string) ImportIDFunc

ImportIDFuncByMultiAttributes is a helper method to define an ImportIDFunc which joins multiple attributes by a given separater.

type Resource

type Resource map[string]interface{}

Resource is a type which is equivalent to a type of Plan.ResourceChanges[].Change.After in hashicorp/terraform-json, but map[string]interface{} is too generic, so we give it a friendly alias. https://pkg.go.dev/github.com/hashicorp/terraform-json#Change

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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