armconversion

package
v0.0.0-...-8ad424e Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConversionTag        = "conversion"
	NoARMConversionValue = "noarmconversion"
)

Variables

This section is empty.

Functions

func GetAzureNameProperty

func GetAzureNameProperty(idFactory astmodel.IdentifierFactory) *astmodel.PropertyDefinition

GetAzureNameProperty returns the special "AzureName" field

func NewARMConversionImplementation

func NewARMConversionImplementation(
	armTypeName astmodel.InternalTypeName,
	armType *astmodel.ObjectType,
	kubeTypeName astmodel.InternalTypeName,
	idFactory astmodel.IdentifierFactory,
	typeKind TypeKind,
) *astmodel.InterfaceImplementation

NewARMConversionImplementation creates an interface implementation with the specified ARM conversion functions

func NewARMSpecInterfaceImpl

func NewARMSpecInterfaceImpl(
	idFactory astmodel.IdentifierFactory,
	resource *astmodel.ResourceType,
	spec *astmodel.ObjectType,
) (*astmodel.InterfaceImplementation, error)

NewARMSpecInterfaceImpl creates a new interface implementation with the functions required to implement the genruntime.ARMResourceSpec interface

Types

type ARMConversionFunction

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

ARMConversionFunction represents an ARM conversion function for converting between a Kubernetes resource and an ARM resource.

func (*ARMConversionFunction) References

func (c *ARMConversionFunction) References() astmodel.TypeNameSet

References returns the set of types to which this function refers. SHOULD include any types which this function references but its receiver doesn't. SHOULD NOT include the receiver of this function.

func (*ARMConversionFunction) RequiredPackageReferences

func (c *ARMConversionFunction) RequiredPackageReferences() *astmodel.PackageReferenceSet

RequiredPackageReferences returns the imports required for this conversion function

type ConvertToARMFunction

type ConvertToARMFunction struct {
	ARMConversionFunction
}

func (*ConvertToARMFunction) AsFunc

func (c *ConvertToARMFunction) AsFunc(
	codeGenerationContext *astmodel.CodeGenerationContext,
	receiver astmodel.InternalTypeName,
) (*dst.FuncDecl, error)

AsFunc returns the function as a Go AST

func (*ConvertToARMFunction) Equals

Equals determines if this function is equal to the passed in function

func (*ConvertToARMFunction) Name

func (c *ConvertToARMFunction) Name() string

type PopulateFromARMFunction

type PopulateFromARMFunction struct {
	ARMConversionFunction
}

func (*PopulateFromARMFunction) AsFunc

func (c *PopulateFromARMFunction) AsFunc(
	codeGenerationContext *astmodel.CodeGenerationContext,
	receiver astmodel.InternalTypeName,
) (*dst.FuncDecl, error)

func (*PopulateFromARMFunction) Equals

Equals determines if this function is equal to the passed in function

func (*PopulateFromARMFunction) Name

func (c *PopulateFromARMFunction) Name() string

type TypeKind

type TypeKind int
const (
	TypeKindOrdinary TypeKind = iota
	TypeKindSpec
	TypeKindStatus
)

Jump to

Keyboard shortcuts

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