parser

package
v0.4.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectorSeparator = "connector--"

ConnectorSeparator is used to separate the connector id and the instance name.

Variables

This section is empty.

Functions

func ParseInstanceID

func ParseInstanceID(is instanceObjectState) (string, error)

ParseInstanceID get the real instance id from the instance object state. The instance id is stored in the "name" attribute of application resource.

func ParseInstanceMetadata

func ParseInstanceMetadata(is instanceObjectState) ([]byte, error)

ParseInstanceMetadata get the metadata from the instance object state.

func ParseInstanceProviderConnector

func ParseInstanceProviderConnector(providerString string) (string, error)

ParseInstanceProviderConnector get the provider connector from the provider instance string.

func ParseStateOutput

func ParseStateOutput(revision *model.ResourceRevision) ([]types.OutputValue, error)

func ParseStateOutputRawMap

func ParseStateOutputRawMap(revision *model.ResourceRevision) (map[string]OutputState, error)

func ParseStateProviders

func ParseStateProviders(s string) ([]string, error)

ParseStateProviders parse terraform state and get providers.

Types

type AbsProviderConfig

type AbsProviderConfig struct {
	Provider Provider
	Alias    string
}

AbsProviderConfig is the absolute address of a provider configuration within a particular module instance.

func ParseAbsProviderConfig

func ParseAbsProviderConfig(traversal hcl.Traversal) (*AbsProviderConfig, error)

ParseAbsProviderConfig parses the given traversal as an absolute provider configuration address.

func ParseAbsProviderString

func ParseAbsProviderString(str string) (*AbsProviderConfig, error)

type OutputState

type OutputState struct {
	Value     property.Value `json:"value"`
	Type      cty.Type       `json:"type"`
	Sensitive bool           `json:"sensitive,omitempty"`
}

type Parser

type Parser struct{}

func (Parser) ParseResourceRevision added in v0.4.0

func (p Parser) ParseResourceRevision(revision *model.ResourceRevision) (
	model.ResourceComponents, map[string][]string, error,
)

ParseResourceRevision parse the service revision output(terraform state) to service resources, returns list must not be `nil` unless unexpected input or raising error, it can be used to clean stale items safety if got an empty list.

func (Parser) ParseState

func (p Parser) ParseState(
	stateStr string,
	revision *model.ResourceRevision,
) (
	resources model.ResourceComponents,
	dependencies map[string][]string,
	err error,
)

ParseState parse the terraform state to service resources, returns list must not be `nil` unless unexpected input or raising error, it can be used to clean stale items safety if got an empty list.

type Provider

type Provider = tfaddr.Provider

Jump to

Keyboard shortcuts

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