common

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddModuleToModuleList

func AddModuleToModuleList(allExternalModules listmodules.ModuleList, newModule CompatibleMEVPlusCoreService) (err error)

func IdentifyAstIdentity

func IdentifyAstIdentity(x ast.Expr) (*ast.Ident, string, bool)

func PackageUrlToSafePath

func PackageUrlToSafePath(pkgURL string) string

func RemoveModuleFromModuleList

func RemoveModuleFromModuleList(moduleToRemove CompatibleMEVPlusCoreService) (err error)

Types

type ArgInfo

type ArgInfo struct {
	Type    reflect.Type
	Kind    reflect.Kind
	PkgPath string
}

type CompatibleMEVPlusCoreService

type CompatibleMEVPlusCoreService struct {
	Name           string        // the name of the module
	Variable       *ast.Ident    // the variable that holds the struct
	StructDef      *ast.Ident    // the struct definition
	ImportPath     string        // the import path of the struct
	FilePath       string        // the go file path of the struct
	PkgDir         string        // the package directory
	GenerativeFunc *ast.FuncDecl // the function that generates the struct
}

type InterfaceChecker

type InterfaceChecker struct {
	InterfaceName string
	PkgPath       string
	Methods       []MethodInfo
}

InterfaceChecker checks if a package has a struct that meets a specified interface.

func (*InterfaceChecker) ImplementsInterface

func (ic *InterfaceChecker) ImplementsInterface(file *ast.File) (variable *ast.Ident, identifiedStruct *ast.Ident, ok bool)

type MethodInfo

type MethodInfo struct {
	Name    string
	Args    []ArgInfo
	Returns []OutputInfo
}

MethodInfo stores information about a method, including its name, argument types, and return types.

type OutputInfo

type OutputInfo struct {
	Type    reflect.Type
	Kind    reflect.Kind
	PkgPath string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL