Documentation ¶
Overview ¶
A programming model for composable configuration
Index ¶
- func ConstructMetadata_DISABLE_STACK_TRACE_IN_METADATA() *string
- func ConstructMetadata_ERROR_METADATA_KEY() *string
- func ConstructMetadata_INFO_METADATA_KEY() *string
- func ConstructMetadata_WARNING_METADATA_KEY() *string
- func NewConstruct_Override(c Construct, scope Construct, id *string, options *ConstructOptions)
- func NewNode_Override(n Node, host Construct, scope IConstruct, id *string)
- func Node_PATH_SEP() *string
- type Construct
- type ConstructMetadata
- type ConstructOptions
- type ConstructOrder
- type Dependency
- type IAspect
- type IConstruct
- type INodeFactory
- type ISynthesisSession
- type IValidation
- type MetadataEntry
- type Node
- type SynthesisOptions
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructMetadata_DISABLE_STACK_TRACE_IN_METADATA ¶ added in v3.3.69
func ConstructMetadata_DISABLE_STACK_TRACE_IN_METADATA() *string
func ConstructMetadata_ERROR_METADATA_KEY ¶ added in v3.3.69
func ConstructMetadata_ERROR_METADATA_KEY() *string
func ConstructMetadata_INFO_METADATA_KEY ¶ added in v3.3.69
func ConstructMetadata_INFO_METADATA_KEY() *string
func ConstructMetadata_WARNING_METADATA_KEY ¶ added in v3.3.69
func ConstructMetadata_WARNING_METADATA_KEY() *string
func NewConstruct_Override ¶ added in v3.3.69
func NewConstruct_Override(c Construct, scope Construct, id *string, options *ConstructOptions)
Creates a new construct node.
func NewNode_Override ¶ added in v3.3.69
func NewNode_Override(n Node, host Construct, scope IConstruct, id *string)
func Node_PATH_SEP ¶ added in v3.3.69
func Node_PATH_SEP() *string
Types ¶
type Construct ¶
type Construct interface { IConstruct OnPrepare() OnSynthesize(session ISynthesisSession) OnValidate() *[]*string ToString() *string }
Represents the building block of the construct graph.
All constructs besides the root construct must be created within the scope of another construct.
func NewConstruct ¶
func NewConstruct(scope Construct, id *string, options *ConstructOptions) Construct
Creates a new construct node.
type ConstructOptions ¶
type ConstructOptions struct { // A factory for attaching `Node`s to the construct. NodeFactory INodeFactory `json:"nodeFactory"` }
Options for creating constructs.
type ConstructOrder ¶
type ConstructOrder string
In what order to return constructs.
const ( ConstructOrder_PREORDER ConstructOrder = "PREORDER" ConstructOrder_POSTORDER ConstructOrder = "POSTORDER" )
type Dependency ¶
type Dependency struct { // Source the dependency. Source IConstruct `json:"source"` // Target of the dependency. Target IConstruct `json:"target"` }
A single dependency.
type IAspect ¶
type IAspect interface { // All aspects can visit an IConstruct. Visit(node IConstruct) }
Represents an Aspect.
type INodeFactory ¶
type INodeFactory interface { // Returns a new `Node` associated with `host`. CreateNode(host Construct, scope IConstruct, id *string) Node }
A factory for attaching `Node`s to the construct.
type ISynthesisSession ¶
type ISynthesisSession interface { // The output directory for this synthesis session. Outdir() *string }
Represents a single session of synthesis.
Passed into `construct.onSynthesize()` methods.
type IValidation ¶
type IValidation interface { // Validate the current construct. // // This method can be implemented by derived constructs in order to perform // validation logic. It is called on all constructs before synthesis. // // Returns: An array of validation error messages, or an empty array if there the construct is valid. Validate() *[]*string }
Implement this interface in order for the construct to be able to validate itself.
type MetadataEntry ¶
type MetadataEntry struct { // The data. Data interface{} `json:"data"` // The metadata entry type. Type *string `json:"type"` // Stack trace. // // Can be omitted by setting the context key // `ConstructMetadata.DISABLE_STACK_TRACE_IN_METADATA` to 1. Trace *[]*string `json:"trace"` }
An entry in the construct metadata table.
type Node ¶
type Node interface { Addr() *string Children() *[]IConstruct DefaultChild() IConstruct SetDefaultChild(val IConstruct) Dependencies() *[]*Dependency Id() *string Locked() *bool Metadata() *[]*MetadataEntry Path() *string Root() IConstruct Scope() IConstruct Scopes() *[]IConstruct UniqueId() *string AddDependency(dependencies ...IConstruct) AddError(message *string) AddInfo(message *string) AddMetadata(type_ *string, data interface{}, fromFunction interface{}) AddValidation(validation IValidation) AddWarning(message *string) ApplyAspect(aspect IAspect) FindAll(order ConstructOrder) *[]IConstruct FindChild(id *string) IConstruct Prepare() SetContext(key *string, value interface{}) Synthesize(options *SynthesisOptions) TryFindChild(id *string) IConstruct TryGetContext(key *string) interface{} TryRemoveChild(childName *string) *bool Validate() *[]*ValidationError }
Represents the construct node in the scope tree.
func Node_Of ¶
func Node_Of(construct IConstruct) Node
Returns the node associated with a construct.
type SynthesisOptions ¶
type SynthesisOptions struct { // The output directory into which to synthesize the cloud assembly. Outdir *string `json:"outdir"` // Additional context passed into the synthesis session object when `construct.synth` is called. SessionContext *map[string]interface{} `json:"sessionContext"` // Whether synthesis should skip the validation phase. SkipValidation *bool `json:"skipValidation"` }
Options for synthesis.
type ValidationError ¶
type ValidationError struct { // The error message. Message *string `json:"message"` // The construct which emitted the error. Source Construct `json:"source"` }
An error returned during the validation phase.