execgraphproto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package execgraphproto contains just the protocol buffers models we use for marshaling and unmarshaling execution graphs.

The logic for converting to and from the types defined in here is encapsulated in package execgraph. The specific serialization format for execution graphs is an implementation detail that may change arbitrarily between OpenTofu versions: it's not supported to take an execution graph marshaled by one OpenTofu version and then try to unmarshal it with a different OpenTofu version. Even the fact that there is an execution graph _at all_ is an implementation detail, with the public-facing model only representing a set of high-level actions against resource instances and output values.

Index

Constants

View Source
const Element_ConstantProviderInstAddr_case case_Element_Request = 3
View Source
const Element_ConstantResourceInstAddr_case case_Element_Request = 2
View Source
const Element_ConstantValue_case case_Element_Request = 1
View Source
const Element_DeposedKey_case case_Element_Request = 6
View Source
const Element_Operation_case case_Element_Request = 4
View Source
const Element_Request_not_set_case case_Element_Request = 0
View Source
const Element_Waiter_case case_Element_Request = 5

Variables

View Source
var File_execgraph_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type DeposedResourceInstanceObject

type DeposedResourceInstanceObject struct {
	XXX_raceDetectHookData protoimpl.RaceDetectHookData
	XXX_presence           [1]uint32
	// contains filtered or unexported fields
}

func (*DeposedResourceInstanceObject) ClearDeposedKey

func (x *DeposedResourceInstanceObject) ClearDeposedKey()

func (*DeposedResourceInstanceObject) ClearInstanceAddr

func (x *DeposedResourceInstanceObject) ClearInstanceAddr()

func (*DeposedResourceInstanceObject) GetDeposedKey

func (x *DeposedResourceInstanceObject) GetDeposedKey() string

func (*DeposedResourceInstanceObject) GetInstanceAddr

func (x *DeposedResourceInstanceObject) GetInstanceAddr() string

func (*DeposedResourceInstanceObject) HasDeposedKey

func (x *DeposedResourceInstanceObject) HasDeposedKey() bool

func (*DeposedResourceInstanceObject) HasInstanceAddr

func (x *DeposedResourceInstanceObject) HasInstanceAddr() bool

func (*DeposedResourceInstanceObject) ProtoMessage

func (*DeposedResourceInstanceObject) ProtoMessage()

func (*DeposedResourceInstanceObject) ProtoReflect

func (*DeposedResourceInstanceObject) Reset

func (x *DeposedResourceInstanceObject) Reset()

func (*DeposedResourceInstanceObject) SetDeposedKey

func (x *DeposedResourceInstanceObject) SetDeposedKey(v string)

func (*DeposedResourceInstanceObject) SetInstanceAddr

func (x *DeposedResourceInstanceObject) SetInstanceAddr(v string)

func (*DeposedResourceInstanceObject) String

type DeposedResourceInstanceObject_builder

type DeposedResourceInstanceObject_builder struct {

	// A fully-qualified resource instance address in the
	// syntax that addrs.AbsResourceInstance.String produces.
	InstanceAddr *string
	// The key of the requested deposed object associated with the
	// resource instance.
	DeposedKey *string
	// contains filtered or unexported fields
}

func (DeposedResourceInstanceObject_builder) Build

type Element

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

One "element" of an execution graph. Refer to ExecutionGraph.elements for more information.

func (*Element) ClearConstantProviderInstAddr

func (x *Element) ClearConstantProviderInstAddr()

func (*Element) ClearConstantResourceInstAddr

func (x *Element) ClearConstantResourceInstAddr()

func (*Element) ClearConstantValue

func (x *Element) ClearConstantValue()

func (*Element) ClearDeposedKey

func (x *Element) ClearDeposedKey()

func (*Element) ClearOperation

func (x *Element) ClearOperation()

func (*Element) ClearRequest

func (x *Element) ClearRequest()

func (*Element) ClearWaiter

func (x *Element) ClearWaiter()

func (*Element) GetConstantProviderInstAddr

func (x *Element) GetConstantProviderInstAddr() string

func (*Element) GetConstantResourceInstAddr

func (x *Element) GetConstantResourceInstAddr() string

func (*Element) GetConstantValue

func (x *Element) GetConstantValue() []byte

func (*Element) GetDeposedKey

func (x *Element) GetDeposedKey() string

func (*Element) GetOperation

func (x *Element) GetOperation() *Operation

func (*Element) GetWaiter

func (x *Element) GetWaiter() *Waiter

func (*Element) HasConstantProviderInstAddr

func (x *Element) HasConstantProviderInstAddr() bool

func (*Element) HasConstantResourceInstAddr

func (x *Element) HasConstantResourceInstAddr() bool

func (*Element) HasConstantValue

func (x *Element) HasConstantValue() bool

func (*Element) HasDeposedKey

func (x *Element) HasDeposedKey() bool

func (*Element) HasOperation

func (x *Element) HasOperation() bool

func (*Element) HasRequest

func (x *Element) HasRequest() bool

func (*Element) HasWaiter

func (x *Element) HasWaiter() bool

func (*Element) ProtoMessage

func (*Element) ProtoMessage()

func (*Element) ProtoReflect

func (x *Element) ProtoReflect() protoreflect.Message

func (*Element) Reset

func (x *Element) Reset()

func (*Element) SetConstantProviderInstAddr

func (x *Element) SetConstantProviderInstAddr(v string)

func (*Element) SetConstantResourceInstAddr

func (x *Element) SetConstantResourceInstAddr(v string)

func (*Element) SetConstantValue

func (x *Element) SetConstantValue(v []byte)

func (*Element) SetDeposedKey

func (x *Element) SetDeposedKey(v string)

func (*Element) SetOperation

func (x *Element) SetOperation(v *Operation)

func (*Element) SetWaiter

func (x *Element) SetWaiter(v *Waiter)

func (*Element) String

func (x *Element) String() string

func (*Element) WhichRequest

func (x *Element) WhichRequest() case_Element_Request

type Element_builder

type Element_builder struct {

	// Fields of oneof xxx_hidden_Request:
	// A constant value, corresponding to execgraph.Builder.ConstantValue.
	//
	// The value is a MessagePack serialization of a cty.Value using
	// cty.DynamicPseudoType as the serialization type constraint, and so
	// this represents both the value and the value's dynamic type.
	ConstantValue []byte
	// A constant address for a resource instance, corresponding to
	// execgraph.Builder.ConstantResourceInstAddr.
	//
	// The value is a fully-qualified resource instance address in the
	// usual syntax.
	ConstantResourceInstAddr *string
	// A constant "deposed key" for a resource instance object,
	// corresponding to execgraph.Builder.ConstantDeposedKey.
	//
	// The value is a string that can be converted to states.DeposedKey.
	DeposedKey *string
	// A constant address for a provider instance, corresponding to
	// execgraph.Builder.ConstantProviderInstAddr.
	//
	// The value is a fully-qualified provider instance address in the
	// usual syntax.
	ConstantProviderInstAddr *string
	// An operation to be performed during execution, corresponding to
	// various different methods of execgraph.Builder depending on the
	// opcode.
	//
	// The unmarshal code is responsible for figuring out which Builder
	// method to call based on the opcode, handled as part of its validation
	// logic.
	Operation *Operation
	// A collection of results whose completion an operation can depend
	// on without actually making any use of the values they produce.
	//
	// We use this to represent explicit dependencies between resource
	// instances and providers so that the execution order will respect
	// the dependencies regardless of whether the dependencies were
	// inferred automatically from expressions or declared explicitly
	// using a "depends_on" argument.
	Waiter *Waiter
	// contains filtered or unexported fields
}

func (Element_builder) Build

func (b0 Element_builder) Build() *Element

type ExecutionGraph

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

ExecutionGraph is the root message type for an execution graph file.

Note that we expect execution graphs to be saved as part of a larger plan file structure that should represent general metadata such as which OpenTofu version a particular execution graph was created by. This message type and its nested message types are focused only on representing the details of the execution graph itself.

func (*ExecutionGraph) GetElements

func (x *ExecutionGraph) GetElements() []*Element

func (*ExecutionGraph) GetResourceInstanceResults

func (x *ExecutionGraph) GetResourceInstanceResults() map[string]uint64

func (*ExecutionGraph) ProtoMessage

func (*ExecutionGraph) ProtoMessage()

func (*ExecutionGraph) ProtoReflect

func (x *ExecutionGraph) ProtoReflect() protoreflect.Message

func (*ExecutionGraph) Reset

func (x *ExecutionGraph) Reset()

func (*ExecutionGraph) SetElements

func (x *ExecutionGraph) SetElements(v []*Element)

func (*ExecutionGraph) SetResourceInstanceResults

func (x *ExecutionGraph) SetResourceInstanceResults(v map[string]uint64)

func (*ExecutionGraph) String

func (x *ExecutionGraph) String() string

type ExecutionGraph_builder

type ExecutionGraph_builder struct {

	// The various "elements" of the graph.
	//
	// This current serialization should be thought of as a sequence of
	// mutations that each add something new to the graph, where the available
	// actions correspond to the methods of execgraph.Builder. Each message
	// in the sequence therefore corresponds to a method called on an internal
	// builder used to reconstruct the graph during unmarshaling.
	//
	// We use execgraph.Builder when reloading because that helps us to
	// validate the graph data using the result type information produced by
	// the builder method results, although a round-trip through this
	// serialization only guarantees a functionally-equivalent graph, not an
	// exactly-identical graph. (i.e. the internal slices used to represent
	// the graph elements might be in a different order after round-tripping,
	// and the text-based debug representation of the graph will reflect
	// those changes even though the graph _topology_ should be identical.)
	Elements []*Element
	// Map from resource instance addresses to indices into the "elements"
	// field, specifying which element produces the "final state" result
	// for each resource instance.
	ResourceInstanceResults map[string]uint64
	// contains filtered or unexported fields
}

func (ExecutionGraph_builder) Build

type Operation

type Operation struct {
	XXX_raceDetectHookData protoimpl.RaceDetectHookData
	XXX_presence           [1]uint32
	// contains filtered or unexported fields
}

func (*Operation) ClearOpcode

func (x *Operation) ClearOpcode()

func (*Operation) GetOpcode

func (x *Operation) GetOpcode() uint64

func (*Operation) GetOperands

func (x *Operation) GetOperands() []uint64

func (*Operation) HasOpcode

func (x *Operation) HasOpcode() bool

func (*Operation) ProtoMessage

func (*Operation) ProtoMessage()

func (*Operation) ProtoReflect

func (x *Operation) ProtoReflect() protoreflect.Message

func (*Operation) Reset

func (x *Operation) Reset()

func (*Operation) SetOpcode

func (x *Operation) SetOpcode(v uint64)

func (*Operation) SetOperands

func (x *Operation) SetOperands(v []uint64)

func (*Operation) String

func (x *Operation) String() string

type Operation_builder

type Operation_builder struct {

	// The raw opcode of the operation to be performed.
	Opcode *uint64
	// The result ids for all of the operands. The number of results and their
	// meanings depend on the opcode, and are validated during unmarshaling.
	Operands []uint64
	// contains filtered or unexported fields
}

func (Operation_builder) Build

func (b0 Operation_builder) Build() *Operation

type Waiter

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

func (*Waiter) GetResults

func (x *Waiter) GetResults() []uint64

func (*Waiter) ProtoMessage

func (*Waiter) ProtoMessage()

func (*Waiter) ProtoReflect

func (x *Waiter) ProtoReflect() protoreflect.Message

func (*Waiter) Reset

func (x *Waiter) Reset()

func (*Waiter) SetResults

func (x *Waiter) SetResults(v []uint64)

func (*Waiter) String

func (x *Waiter) String() string

type Waiter_builder

type Waiter_builder struct {

	// Result ids of all of the results that must be awaited.
	Results []uint64
	// contains filtered or unexported fields
}

func (Waiter_builder) Build

func (b0 Waiter_builder) Build() *Waiter

Jump to

Keyboard shortcuts

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