parser

package
v0.3.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 18 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.ServiceRevision) ([]types.OutputValue, error)

func ParseStateOutputRawMap

func ParseStateOutputRawMap(revision *model.ServiceRevision) (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      property.Type  `json:"type"`
	Sensitive bool           `json:"sensitive,omitempty"`
}

type Parser

type Parser struct{}

func (Parser) ParseServiceRevision

func (p Parser) ParseServiceRevision(revision *model.ServiceRevision) (
	model.ServiceResources, map[string][]string, error,
)

ParseServiceRevision 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.ServiceRevision,
) (
	resources model.ServiceResources,
	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