generictools

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyJson = "jsonencode({})"
View Source
const EmptyMap = "{}"
View Source
const EmptyString = "null"
View Source
const ParentIdentifier = "parent_id"

Variables

This section is empty.

Functions

func CreateVariablesFile

func CreateVariablesFile(contentToCreate VariableContent, directory string)

func ExtractBlockInformation

func ExtractBlockInformation(inBlocks []string) (blockType string, blockIdentifier string, resourceAddress string)

func GetHclFile

func GetHclFile(entryName string) (f *hclwrite.File)

func GetStringToken

func GetStringToken(tokens hclwrite.Tokens) (value string)

func IsGlobalAccountParent

func IsGlobalAccountParent(btpClient *btpcli.ClientFacade, parentId string) (isParent bool)

func ProcessChanges

func ProcessChanges(f *hclwrite.File, path string)

func ProcessParentAttribute

func ProcessParentAttribute(body *hclwrite.Body, description string, btpClient *btpcli.ClientFacade, variables *VariableContent)

func RemoveConfigBlock

func RemoveConfigBlock(body *hclwrite.Body, resourceAddress string)

func RemoveEmptyAttributes

func RemoveEmptyAttributes(body *hclwrite.Body)

func RemoveEmptyFiles

func RemoveEmptyFiles(dir string) error

func RemoveImportBlock

func RemoveImportBlock(body *hclwrite.Body, resourceAddress string, resultStore *map[string]int)

func RemoveUnusedImports

func RemoveUnusedImports(directory string, blocksToRemove *[]BlockSpecifier, resultStore *map[string]int)

func ReplaceAttribute

func ReplaceAttribute(body *hclwrite.Body, identifier string, description string, variables *VariableContent)

func ReplaceDependency

func ReplaceDependency(tokens hclwrite.Tokens, dependencyAddress string) (replacedTokens hclwrite.Tokens)

func ReplaceMainDependency

func ReplaceMainDependency(body *hclwrite.Body, mainIdentifier string, mainAddress string)

func ReplaceStringTokenVar

func ReplaceStringTokenVar(tokens hclwrite.Tokens, identifier string) (replacedTokens hclwrite.Tokens, valueForVariable string)

Types

type BlockSpecifier

type BlockSpecifier struct {
	BlockIdentifier string
	ResourceAddress string
}

type DataSourceInfo

type DataSourceInfo struct {
	DatasourceAddress  string
	SubaccountAddress  string
	OfferingName       string
	Name               string
	EntitlementAddress string
}

type DependencyAddresses added in v1.1.0

type DependencyAddresses struct {
	SubaccountAddress  string
	DirectoryAddress   string
	SpaceAddress       map[string]string
	EntitlementAddress map[EntitlementKey]EntitlementInfo
	RoleAddress        map[RoleKey]string
	DataSourceInfo     []DataSourceInfo
	BlocksToRemove     []BlockSpecifier
}

func NewDependencyAddresses

func NewDependencyAddresses() DependencyAddresses

type EntitlementInfo added in v1.3.0

type EntitlementInfo struct {
	Amount  int
	Address string
}

type EntitlementKey

type EntitlementKey struct {
	ServiceName string
	PlanName    string
}

type LevelIds

type LevelIds struct {
	SubaccountId string
	DirectoryId  string
	CfOrgId      string
}

type RoleKey

type RoleKey struct {
	AppId            string
	Name             string
	RoleTemplateName string
}

type VariableContent

type VariableContent map[string]VariableInfo

type VariableInfo

type VariableInfo struct {
	Description  string
	DefaultValue string
	Type         string
}

Jump to

Keyboard shortcuts

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