Documentation ¶
Index ¶
- Variables
- func FindPkgNameRefs(pkg *pkginfo.Package, pkgNames []pkginfo.QualifiedName, ...)
- func NodeType(node ast.Node) string
- func ParseReference(p *resourceparser.Pass, spec *ReferenceSpec, data ReferenceData)
- func ParseResourceName(errs *perr.List, resourceType string, paramName string, node ast.Expr, ...) string
- type ReferenceData
- type ReferenceInfo
- type ReferenceSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var KebabName = resourceNameSpec{ // contains filtered or unexported fields }
View Source
var SnakeName = resourceNameSpec{ // contains filtered or unexported fields }
Functions ¶
func FindPkgNameRefs ¶
func FindPkgNameRefs(pkg *pkginfo.Package, pkgNames []pkginfo.QualifiedName, fn func(f *pkginfo.File, name pkginfo.QualifiedName, stack []ast.Node))
FindPkgNameRefs finds all references in the given package that references any of the given pkgNames. For each such reference it calls fn.
func NodeType ¶
NodeType converts a node to a string that can be used in an error message. such as a ast.CallExpr will return "a function call to foo.Blah"
func ParseReference ¶
func ParseReference(p *resourceparser.Pass, spec *ReferenceSpec, data ReferenceData)
func ParseResourceName ¶
func ParseResourceName(errs *perr.List, resourceType string, paramName string, node ast.Expr, nameSpec resourceNameSpec, reservedPrefix string) string
ParseResourceName checks the given node is a string literal and that it conforms to the given spec.
If an error is encountered, it will report a parse error and return an empty string otherwise it will return the parsed resource name
Types ¶
type ReferenceData ¶
type ReferenceInfo ¶
type ReferenceSpec ¶
type ReferenceSpec struct { MinTypeArgs int MaxTypeArgs int Parse func(ReferenceInfo) }
Click to show internal directories.
Click to hide internal directories.