Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterUsageResolver ¶
func RegisterUsageResolver[Res resource.Resource](r *Resolver, fn func(ResolveData, Res) Usage)
Types ¶
type Expr ¶
type Expr interface { // Node allows use to use the expression in error messages // where the Pos/End is used to point directly at the resource // bind being used, rather than the overall expression. ast.Node ResourceBind() resource.Bind ASTExpr() ast.Expr DeclaredIn() *pkginfo.File // DescriptionForTest describes the expression for testing purposes. DescriptionForTest() string }
type FieldAccess ¶
type FieldAccess struct { File *pkginfo.File Bind resource.Bind Expr *ast.SelectorExpr Field string }
FieldAccess describes a resource usage via a field access.
func (*FieldAccess) ASTExpr ¶
func (f *FieldAccess) ASTExpr() ast.Expr
func (*FieldAccess) DeclaredIn ¶
func (f *FieldAccess) DeclaredIn() *pkginfo.File
func (*FieldAccess) DescriptionForTest ¶
func (f *FieldAccess) DescriptionForTest() string
func (*FieldAccess) End ¶
func (f *FieldAccess) End() token.Pos
func (*FieldAccess) Pos ¶
func (f *FieldAccess) Pos() token.Pos
func (*FieldAccess) ResourceBind ¶
func (f *FieldAccess) ResourceBind() resource.Bind
type FuncArg ¶
type FuncArg struct { File *pkginfo.File Bind resource.Bind Call *ast.CallExpr // TypeArgs are the type arguments to the function being called, if any. TypeArgs []schema.Type // ArgIdx is the function argument index that represents // the resource bind, starting at 0. ArgIdx int // PkgFunc is the package-level function that's being called. // It's None if the function is not a package-level function. PkgFunc option.Option[pkginfo.QualifiedName] }
FuncArg describes a resource being used as a function argument.
func (*FuncArg) DeclaredIn ¶
func (*FuncArg) DescriptionForTest ¶
func (*FuncArg) ResourceBind ¶
type FuncCall ¶
FuncCall describes a resource being called as a function.
func (*FuncCall) DeclaredIn ¶
func (*FuncCall) DescriptionForTest ¶
func (*FuncCall) ResourceBind ¶
type MethodCall ¶
type MethodCall struct { File *pkginfo.File Bind resource.Bind Call *ast.CallExpr Method string Args []ast.Expr }
MethodCall describes a resource usage via a method call.
func (*MethodCall) ASTExpr ¶
func (m *MethodCall) ASTExpr() ast.Expr
func (*MethodCall) DeclaredIn ¶
func (m *MethodCall) DeclaredIn() *pkginfo.File
func (*MethodCall) DescriptionForTest ¶
func (m *MethodCall) DescriptionForTest() string
func (*MethodCall) End ¶
func (m *MethodCall) End() token.Pos
func (*MethodCall) Pos ¶
func (m *MethodCall) Pos() token.Pos
func (*MethodCall) ResourceBind ¶
func (m *MethodCall) ResourceBind() resource.Bind
type Other ¶
Other describes any other resource usage.
func (*Other) DeclaredIn ¶
func (*Other) DescriptionForTest ¶
func (*Other) ResourceBind ¶
type ResolveData ¶
ResolveData is the data being passed to usage resolver functions.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver() *Resolver
Click to show internal directories.
Click to hide internal directories.