Documentation
¶
Index ¶
- Constants
- func RunAnalyzerOnSrc(an *analysis.Analyzer, src string, ...) ([]analysis.Diagnostic, error)
- func SpoofCommonK8s(f *ast.File, info *types.Info)
- func SpoofCommonStdLib(f *ast.File, info *types.Info)
- func SpoofControllerRuntimeResult(f *ast.File, info *types.Info)
- func SpoofInformers(f *ast.File, info *types.Info)
- func SpoofListOptionsType(f *ast.File, info *types.Info)
- func SpoofRBACTypes(f *ast.File, info *types.Info)
- func SpoofReconcileSignature(f *ast.File, info *types.Info)
- func SpoofRestConfig(f *ast.File, info *types.Info)
- func SpoofRestMapper(f *ast.File, info *types.Info)
- func SpoofUnstructuredTypes(f *ast.File, info *types.Info)
- func SpoofUsesFromMap(m SpoofMap) func(f *ast.File, info *types.Info)
- func SpoofWorkqueue(f *ast.File, info *types.Info)
- type SpoofMap
Constants ¶
const ( PkgKubernetes = "k8s.io/client-go/kubernetes" PkgRest = "k8s.io/client-go/rest" PkgDynamic = "k8s.io/client-go/dynamic" PkgDiscovery = "k8s.io/client-go/discovery" PkgRestMapper = "k8s.io/client-go/restmapper" PkgControllerRuntime = "sigs.k8s.io/controller-runtime/pkg/client" PkgReconcile = "sigs.k8s.io/controller-runtime/pkg/reconcile" PkgMetaV1 = "k8s.io/apimachinery/pkg/apis/meta/v1" PkgTime = "time" )
Variables ¶
This section is empty.
Functions ¶
func RunAnalyzerOnSrc ¶
func RunAnalyzerOnSrc(an *analysis.Analyzer, src string, spoofs ...func(f *ast.File, info *types.Info)) ([]analysis.Diagnostic, error)
RunAnalyzerOnSrc parses src, builds a minimal analysis.Pass with inspector and types info, applies optional spoof callbacks, runs the analyzer, and returns collected diagnostics.
func SpoofCommonK8s ¶
SpoofCommonK8s applies common Kubernetes type spoofing
func SpoofCommonStdLib ¶
SpoofCommonStdLib applies standard library spoofing (e.g., time.Sleep)
func SpoofControllerRuntimeResult ¶
SpoofControllerRuntimeResult applies Result type spoofing for controller-runtime
func SpoofInformers ¶
SpoofInformers applies informer-specific spoofing for Kubernetes informers
func SpoofListOptionsType ¶
SpoofListOptionsType adds ListOptions type spoofing to types.Info
func SpoofRBACTypes ¶
SpoofRBACTypes applies RBAC type spoofing for ClusterRole, PolicyRule, etc.
func SpoofReconcileSignature ¶
SpoofReconcileSignature adds a Reconcile method signature to the types.Info
func SpoofRestConfig ¶
SpoofRestConfig applies rest.Config type spoofing
func SpoofRestMapper ¶
SpoofRestMapper applies REST mapper function spoofing
func SpoofUnstructuredTypes ¶
SpoofUnstructuredTypes applies Unstructured type spoofing
func SpoofUsesFromMap ¶
SpoofUsesFromMap returns a spoof function that assigns types.Func objects for callees whose name appears in the provided map, using the map's pkg path.
Types ¶
type SpoofMap ¶
SpoofMap maps function names to package import paths for creating fake Uses.
func CommonK8sSpoofMap ¶
func CommonK8sSpoofMap() SpoofMap
CommonK8sSpoofMap returns a SpoofMap with common Kubernetes function names
func CommonStdLibSpoofMap ¶
func CommonStdLibSpoofMap() SpoofMap
CommonStdLibSpoofMap returns a SpoofMap with Go standard library functions
func RestMapperSpoofMap ¶
func RestMapperSpoofMap() SpoofMap
RestMapperSpoofMap returns functions for REST mapper spoofing
func WorkqueueSpoofMap ¶
func WorkqueueSpoofMap() SpoofMap
WorkqueueSpoofMap returns functions for workqueue spoofing