json

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSParser = jsoniter.Config{
	TagKey: "json",

	SortMapKeys: true,
}.Froze()

JSParser is a json parser to marshal/unmarshal using "json" tag.

View Source
var TFParser = jsoniter.Config{TagKey: "tf"}.Froze()

TFParser is a json parser to marshal/unmarshal using "tf" tag.

Functions

This section is empty.

Types

type InstanceObjectStateV4

type InstanceObjectStateV4 struct {
	IndexKey any    `json:"index_key,omitempty"`
	Status   string `json:"status,omitempty"`
	Deposed  string `json:"deposed,omitempty"`

	SchemaVersion           uint64              `json:"schema_version"`
	AttributesRaw           jsoniter.RawMessage `json:"attributes,omitempty"`
	AttributesFlat          map[string]string   `json:"attributes_flat,omitempty"`
	AttributeSensitivePaths jsoniter.RawMessage `json:"sensitive_attributes,omitempty"`

	PrivateRaw []byte `json:"private,omitempty"`

	Dependencies []string `json:"dependencies,omitempty"`

	CreateBeforeDestroy bool `json:"create_before_destroy,omitempty"`
}

InstanceObjectStateV4 represents a version 4 instance object state

type OutputStateV4

type OutputStateV4 struct {
	ValueRaw     jsoniter.RawMessage `json:"value"`
	ValueTypeRaw jsoniter.RawMessage `json:"type"`
	Sensitive    bool                `json:"sensitive,omitempty"`
}

OutputStateV4 represents a version 4 output state

type ResourceStateV4

type ResourceStateV4 struct {
	Module         string                  `json:"module,omitempty"`
	Mode           string                  `json:"mode"`
	Type           string                  `json:"type"`
	Name           string                  `json:"name"`
	EachMode       string                  `json:"each,omitempty"`
	ProviderConfig string                  `json:"provider"`
	Instances      []InstanceObjectStateV4 `json:"instances"`
}

ResourceStateV4 represents a version 4 resource state

type StateV4

type StateV4 struct {
	Version          uint64                   `json:"version"`
	TerraformVersion string                   `json:"terraform_version"`
	Serial           uint64                   `json:"serial"`
	Lineage          string                   `json:"lineage"`
	RootOutputs      map[string]OutputStateV4 `json:"outputs"`
	Resources        []ResourceStateV4        `json:"resources"`
}

StateV4 represents a version 4 terraform state

func NewStateV4

func NewStateV4() *StateV4

NewStateV4 returns a new base StateV4 object.

func (*StateV4) GetAttributes

func (st *StateV4) GetAttributes() jsoniter.RawMessage

GetAttributes returns attributes of the Terraform managed resource (i.e. first instance of first resource)

func (*StateV4) GetPrivateRaw

func (st *StateV4) GetPrivateRaw() []byte

GetPrivateRaw returns private attribute of the Terraform managed resource that is used as metadata by the Terraform provider

func (*StateV4) GetSensitiveAttributes

func (st *StateV4) GetSensitiveAttributes() jsoniter.RawMessage

GetSensitiveAttributes returns sensitive attributes of the Terraform managed resource (i.e. first instance of first resource)

Jump to

Keyboard shortcuts

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