Documentation
¶
Index ¶
- Constants
- func AddServerSideApplyMarkers(f *Field)
- func AddServerSideApplyMarkersFromConfig(f *Field, cfg *config.Resource) error
- func IsObservation(s *schema.Schema) bool
- func TypePath(i any) string
- type Builder
- type Field
- func NewField(g *Builder, cfg *config.Resource, r *resource, sch *schema.Schema, ...) (*Field, error)
- func NewReferenceField(g *Builder, cfg *config.Resource, r *resource, sch *schema.Schema, ...) (*Field, error)
- func NewSensitiveField(g *Builder, cfg *config.Resource, r *resource, sch *schema.Schema, ...) (*Field, bool, error)
- type Generated
- type TypeNames
Constants ¶
const ( // PackagePathXPCommonAPIs is the go path for the Crossplane Runtime package // with common APIs PackagePathXPCommonAPIs = "github.com/crossplane/crossplane-runtime/apis/common/v1" )
Variables ¶
This section is empty.
Functions ¶
func AddServerSideApplyMarkers ¶ added in v1.1.0
func AddServerSideApplyMarkers(f *Field)
AddServerSideApplyMarkers adds server-side apply comment markers to indicate that scalar maps and sets can be merged granularly, not replace atomically.
func AddServerSideApplyMarkersFromConfig ¶ added in v1.1.0
func IsObservation ¶
IsObservation returns whether the specified Schema belongs to an observed attribute, i.e., whether it's a required computed field.
Types ¶
type Builder ¶
Builder is used to generate Go type equivalence of given Terraform schema.
type Field ¶
type Field struct {
Schema *schema.Schema
Name name.Name
Comment *comments.Comment
TFTag *structtag.Value
JSONTag *structtag.Value
FieldNameCamel string
TerraformPaths, CRDPaths, CanonicalPaths []string
FieldType types.Type
InitType types.Type
AsBlocksMode bool
Reference *config.Reference
TransformedName string
SelectorName string
Identifier bool
Required bool
// Injected is set if this Field is an injected field to the Terraform
// schema as an object list map key for server-side apply merges.
Injected bool
// Sensitive is set if this Field holds sensitive data and is thus
// generated as a secret reference.
Sensitive bool
}
Field represents a field that is built from the Terraform schema. It contains the go field related information such as tags, field type, comment.
func NewField ¶
func NewField(g *Builder, cfg *config.Resource, r *resource, sch *schema.Schema, snakeFieldName string, tfPath, xpPath, names []string, asBlocksMode bool) (*Field, error)
NewField returns a constructed Field object.
func NewReferenceField ¶
func NewReferenceField(g *Builder, cfg *config.Resource, r *resource, sch *schema.Schema, ref *config.Reference, snakeFieldName string, tfPath, xpPath, names []string, asBlocksMode bool) (*Field, error)
NewReferenceField returns a constructed reference Field object.
func NewSensitiveField ¶
func NewSensitiveField(g *Builder, cfg *config.Resource, r *resource, sch *schema.Schema, snakeFieldName string, tfPath, xpPath, names []string, asBlocksMode bool) (*Field, bool, error)
NewSensitiveField returns a constructed sensitive Field object.
func (*Field) AddToResource ¶
func (f *Field) AddToResource(g *Builder, r *resource, typeNames *TypeNames, opt config.SchemaElementOption)
AddToResource adds built field to the resource.
type Generated ¶
type Generated struct {
Types []*types.Named
Comments twtypes.Comments
ForProviderType *types.Named
InitProviderType *types.Named
AtProviderType *types.Named
ValidationRules string
}
Generated is a struct that holds generated types