Skip to content

Commit

Permalink
Mark methods as internal
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek committed Jul 17, 2021
1 parent bb9d264 commit 994c3b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions hack/generator/pkg/functions/resource_conversion_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ func (fn *ResourceConversionFunction) AsFunc(

if fn.hub.Equals(fn.propertyFunction.otherDefinition.Name()) {
// Not using an intermediate step
funcDetails.Body = fn.DirectConversion(receiverName, generationContext)
funcDetails.Body = fn.directConversion(receiverName, generationContext)
} else {
fn.propertyFunction.direction.
WhenFrom(func() { funcDetails.Body = fn.IndirectConversionFromHub(receiverName, generationContext) }).
WhenTo(func() { funcDetails.Body = fn.IndirectConversionToHub(receiverName, generationContext) })
WhenFrom(func() { funcDetails.Body = fn.indirectConversionFromHub(receiverName, generationContext) }).
WhenTo(func() { funcDetails.Body = fn.indirectConversionToHub(receiverName, generationContext) })
}

return funcDetails.DefineFunc()
}

// DirectConversion creates a simple direct conversion between the two types
// directConversion creates a simple direct conversion between the two types
//
// <local>, ok := <hubAsInterface>.(<actualHubType>)
// if !ok {
Expand All @@ -139,7 +139,7 @@ func (fn *ResourceConversionFunction) AsFunc(
//
// return receiver.AssignProperties(To|From)<type>(<local>)
//
func (fn *ResourceConversionFunction) DirectConversion(
func (fn *ResourceConversionFunction) directConversion(
receiverName string, generationContext *astmodel.CodeGenerationContext) []dst.Stmt {
fmtPackage := generationContext.MustGetImportedPackageName(astmodel.FmtReference)

Expand Down Expand Up @@ -167,7 +167,7 @@ func (fn *ResourceConversionFunction) DirectConversion(
copyAndReturn)
}

// IndirectConversionFromHub generates a conversion when the type we know about isn't the hub type, but is closer to it
// indirectConversionFromHub generates a conversion when the type we know about isn't the hub type, but is closer to it
// in our conversion graph
//
// var source <intermediateType>
Expand All @@ -181,7 +181,7 @@ func (fn *ResourceConversionFunction) DirectConversion(
// }
// return nil
//
func (fn *ResourceConversionFunction) IndirectConversionFromHub(
func (fn *ResourceConversionFunction) indirectConversionFromHub(
receiverName string, generationContext *astmodel.CodeGenerationContext) []dst.Stmt {
errorsPackage := generationContext.MustGetImportedPackageName(astmodel.GitHubErrorsReference)
localId := fn.localVariableId()
Expand Down Expand Up @@ -225,7 +225,7 @@ func (fn *ResourceConversionFunction) IndirectConversionFromHub(
returnNil)
}

// IndirectConversionToHub generates a conversion when the type we know about isn't the hub type, but is closer to it in
// indirectConversionToHub generates a conversion when the type we know about isn't the hub type, but is closer to it in
// our conversion graph
//
// var destination <intermediateType>
Expand All @@ -239,7 +239,7 @@ func (fn *ResourceConversionFunction) IndirectConversionFromHub(
// }
// return nil
//
func (fn *ResourceConversionFunction) IndirectConversionToHub(
func (fn *ResourceConversionFunction) indirectConversionToHub(
receiverName string, generationContext *astmodel.CodeGenerationContext) []dst.Stmt {
errorsPackage := generationContext.MustGetImportedPackageName(astmodel.GitHubErrorsReference)
localId := fn.localVariableId()
Expand Down

0 comments on commit 994c3b5

Please sign in to comment.