Documentation ¶
Overview ¶
Package method contains methods that may be generated for a Go type.
Index ¶
- Constants
- type Filter
- type New
- func NewGetCondition(receiver, runtime string) New
- func NewGetDeletionPolicy(receiver, runtime string) New
- func NewGetManagementPolicies(receiver, runtime string) New
- func NewGetProviderConfigReference(receiver, runtime string) New
- func NewGetPublishConnectionDetailsTo(receiver, runtime string) New
- func NewGetResourceReference(receiver, core string) New
- func NewGetRootProviderConfigReference(receiver, runtime string) New
- func NewGetRootResourceReference(receiver, runtime string) New
- func NewGetUsers(receiver string) New
- func NewGetWriteConnectionSecretToReference(receiver, runtime string) New
- func NewLocalGetWriteConnectionSecretToReference(receiver, runtime string) New
- func NewLocalSetWriteConnectionSecretToReference(receiver, runtime string) New
- func NewManagedGetItems(receiver, resource string) New
- func NewProviderConfigUsageGetItems(receiver, resource string) New
- func NewResolveReferences(traverser *xptypes.Traverser, receiver, clientPath, referencePkgPath string) New
- func NewSetConditions(receiver, runtime string) New
- func NewSetDeletionPolicy(receiver, runtime string) New
- func NewSetManagementPolicies(receiver, runtime string) New
- func NewSetProviderConfigReference(receiver, runtime string) New
- func NewSetPublishConnectionDetailsTo(receiver, runtime string) New
- func NewSetResourceReference(receiver, core string) New
- func NewSetRootProviderConfigReference(receiver, runtime string) New
- func NewSetRootResourceReference(receiver, runtime string) New
- func NewSetUsers(receiver string) New
- func NewSetWriteConnectionSecretToReference(receiver, runtime string) New
- type Reference
- type ReferenceProcessor
- type ReferenceProcessorOption
- type Set
Constants ¶
const ( ReferenceTypeMarker = "crossplane:generate:reference:type" ReferenceExtractorMarker = "crossplane:generate:reference:extractor" ReferenceReferenceFieldNameMarker = "crossplane:generate:reference:refFieldName" ReferenceSelectorFieldNameMarker = "crossplane:generate:reference:selectorFieldName" )
Comment markers used by ReferenceProcessor
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
A Filter is a function that determines whether a method should be written for the supplied object. It returns true if the method should be filtered.
func DefinedOutside ¶
DefinedOutside returns a MethodFilter that returns true if the supplied object has a method with the supplied name that is not defined in the supplied filename. The object's filename is determined using the supplied FileSet.
type New ¶
New is a function that adds a method on the supplied object in the supplied file.
func NewGetCondition ¶
NewGetCondition returns a NewMethod that writes a GetCondition method for the supplied Object to the supplied file.
func NewGetDeletionPolicy ¶
NewGetDeletionPolicy returns a NewMethod that writes a GetDeletionPolicy method for the supplied Object to the supplied file.
func NewGetManagementPolicies ¶
NewGetManagementPolicies returns a NewMethod that writes a GetManagementPolicies method for the supplied Object to the supplied file.
func NewGetProviderConfigReference ¶
NewGetProviderConfigReference returns a NewMethod that writes a GetProviderConfigReference method for the supplied Object to the supplied file.
func NewGetPublishConnectionDetailsTo ¶
NewGetPublishConnectionDetailsTo returns a NewMethod that writes a GetPublishConnectionDetailsTo method for the supplied Object to the supplied file.
func NewGetResourceReference ¶
NewGetResourceReference returns a NewMethod that writes a GetResourceReference method for the supplied Object to the supplied file.
func NewGetRootProviderConfigReference ¶
NewGetRootProviderConfigReference returns a NewMethod that writes a GetProviderConfigReference method for the supplied Object to the supplied file. file. Note that unlike NewGetProviderConfigReference the generated method expects the ProviderConfigReference to be at the root of the struct, not under its Spec field.
func NewGetRootResourceReference ¶
NewGetRootResourceReference returns a NewMethod that writes a GetRootResourceReference method for the supplied Object to the supplied file.
func NewGetUsers ¶
NewGetUsers returns a NewMethod that writes a GetUsers method for the supplied Object to the supplied file.
func NewGetWriteConnectionSecretToReference ¶
NewGetWriteConnectionSecretToReference returns a NewMethod that writes a GetWriteConnectionSecretToReference method for the supplied Object to the supplied file.
func NewLocalGetWriteConnectionSecretToReference ¶
NewLocalGetWriteConnectionSecretToReference returns a NewMethod that writes a GetWriteConnectionSecretToReference method for the supplied Object to the supplied file.
func NewLocalSetWriteConnectionSecretToReference ¶
NewLocalSetWriteConnectionSecretToReference returns a NewMethod that writes a SetWriteConnectionSecretToReference method for the supplied Object to the supplied file.
func NewManagedGetItems ¶
NewManagedGetItems returns a New that writes a GetItems method for the supplied object to the supplied file.
func NewProviderConfigUsageGetItems ¶
NewProviderConfigUsageGetItems returns a New that writes a GetItems method for the supplied object to the supplied file.
func NewResolveReferences ¶
func NewResolveReferences(traverser *xptypes.Traverser, receiver, clientPath, referencePkgPath string) New
NewResolveReferences returns a NewMethod that writes a ResolveReferences for given managed resource, if needed.
func NewSetConditions ¶
NewSetConditions returns a NewMethod that writes a SetConditions method for the supplied Object to the supplied file.
func NewSetDeletionPolicy ¶
NewSetDeletionPolicy returns a NewMethod that writes a SetDeletionPolicy method for the supplied Object to the supplied file.
func NewSetManagementPolicies ¶
NewSetManagementPolicies returns a NewMethod that writes a SetManagementPolicies method for the supplied Object to the supplied file.
func NewSetProviderConfigReference ¶
NewSetProviderConfigReference returns a NewMethod that writes a SetProviderConfigReference method for the supplied Object to the supplied file.
func NewSetPublishConnectionDetailsTo ¶
NewSetPublishConnectionDetailsTo returns a NewMethod that writes a NewSetPublishConnectionDetailsTo method for the supplied Object to the supplied file.
func NewSetResourceReference ¶
NewSetResourceReference returns a NewMethod that writes a SetResourceReference method for the supplied Object to the supplied file.
func NewSetRootProviderConfigReference ¶
NewSetRootProviderConfigReference returns a NewMethod that writes a SetProviderConfigReference method for the supplied Object to the supplied file. Note that unlike NewSetProviderConfigReference the generated method expects the ProviderConfigReference to be at the root of the struct, not under its Spec field.
func NewSetRootResourceReference ¶
NewSetRootResourceReference returns a NewMethod that writes a SetRootResourceReference method for the supplied Object to the supplied file.
func NewSetUsers ¶
NewSetUsers returns a NewMethod that writes a SetUsers method for the supplied Object to the supplied file.
func NewSetWriteConnectionSecretToReference ¶
NewSetWriteConnectionSecretToReference returns a NewMethod that writes a SetWriteConnectionSecretToReference method for the supplied Object to the supplied file.
type Reference ¶
type Reference struct { // RemoteType represents the type whose reference we're holding. RemoteType *jen.Statement // Extractor is the function call of the function that will take referenced // instance and return a string or []string to be set as value. Extractor *jen.Statement // RemoteListType is the list type of the type whose reference we're holding. RemoteListType *jen.Statement // GoValueFieldPath is the list of fields that needs to be traveled to access // the current value field. It may include prefixes like [] for array fields, // * for pointer fields or []* for array of pointer fields. GoValueFieldPath []string // GoRefFieldName is the name of the field whose type is *xpv1.Reference or // []xpv1.Reference. GoRefFieldName string // GoSelectorFieldName is the name of the field whose type is *xpv1.Selector GoSelectorFieldName string // IsSlice tells whether the current value type is a slice kind. IsSlice bool // IsPointer tells whether the current value type is a pointer kind. IsPointer bool // IsFloatPointer tells whether the current value pointer is of type float64 IsFloatPointer bool }
Reference is the internal representation that has enough information to let us generate the resolver.
type ReferenceProcessor ¶
type ReferenceProcessor struct { // DefaultExtractor is used when the extractor is not overridden. DefaultExtractor *jen.Statement // Receiver is prepended to all field paths. Receiver string // contains filtered or unexported fields }
ReferenceProcessor detects whether the field is marked as referencer and composes the internal representation of that reference.
func NewReferenceProcessor ¶
func NewReferenceProcessor(receiver string, opts ...ReferenceProcessorOption) *ReferenceProcessor
NewReferenceProcessor returns a new *ReferenceProcessor .
func (*ReferenceProcessor) GetReferences ¶
func (rp *ReferenceProcessor) GetReferences() []Reference
GetReferences returns all the references accumulated so far from processing.
type ReferenceProcessorOption ¶
type ReferenceProcessorOption func(*ReferenceProcessor)
ReferenceProcessorOption is used to configure ReferenceProcessor.
func WithDefaultExtractor ¶
func WithDefaultExtractor(ext *jen.Statement) ReferenceProcessorOption
WithDefaultExtractor returns an option that sets the extractor to given call.