Documentation ¶
Index ¶
- Variables
- func ExtractSymbol(universe *tinypkg.Universe, here *tinypkg.Package, s reflectshape.Shape) tinypkg.Node
- type Config
- type Def
- type GetSymbolFunc
- type Item
- type Kind
- type Logger
- type Module
- type Need
- type PreModule
- type Resolver
- func (r *Resolver) Def(fn interface{}) *Def
- func (r *Resolver) DetectKind(s reflectshape.Shape) Kind
- func (r *Resolver) NewPackage(path, name string) *tinypkg.Package
- func (r *Resolver) NewPackageFromInterface(ob interface{}, name string) *tinypkg.Package
- func (r *Resolver) PreModule(ob interface{}) (*PreModule, error)
- func (r *Resolver) Shape(ob interface{}) reflectshape.Shape
- func (r *Resolver) Symbol(here *tinypkg.Package, s reflectshape.Shape) tinypkg.Node
- func (r *Resolver) UnsafeShapeExtractor() *reflectshape.Extractor
- type StructFromShapeInfo
- type Tracker
- func (t *Tracker) ExtractComponentFactoryShape(x Item) reflectshape.Shape
- func (t *Tracker) ExtractInterface(here *tinypkg.Package, resolver *Resolver, name string) *tinypkg.Interface
- func (t *Tracker) ExtractMethodName(rt reflect.Type, name string) string
- func (t *Tracker) Override(name string, providerFunc interface{}) (prev *Def, err error)
- func (t *Tracker) Track(def *Def)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidArgs = fmt.Errorf("invalid args")
View Source
var ErrInvalidType = fmt.Errorf("invalid type")
View Source
var ErrNotFound = fmt.Errorf("not found")
Functions ¶
func ExtractSymbol ¶
Types ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() *Config
type Def ¶
func ExtractDef ¶
type Kind ¶
type Kind string
const ( KindComponent Kind = "component" // pointer, function, interface KindData Kind = "data" // struct KindIgnored Kind = "ignoerd" // context.Context KindPrimitive Kind = "primitve" // string, int, ... KindPrimitivePointer Kind = "primitve-pointer" // *string, *int, ... KindUnsupported Kind = "unsupported" // slice, map )
func DetectKind ¶
func DetectKind(s reflectshape.Shape, ignoreMap map[string]bool) Kind
type Module ¶
type Module struct { Args []tinypkg.Node Here *tinypkg.Package // contains filtered or unexported fields }
func (*Module) Shape ¶
func (m *Module) Shape() *reflectshape.Struct
type PreModule ¶
type PreModule struct { Name string Shape *reflectshape.Struct Args []reflectshape.Shape Funcs []reflectshape.Function // contains filtered or unexported fields }
func NewPreModule ¶
func NewPreModule(resolver *Resolver, ob reflectshape.Struct) (*PreModule, error)
type Resolver ¶
type Resolver struct { Config *Config // contains filtered or unexported fields }
func NewResolver ¶
func NewResolver() *Resolver
func (*Resolver) DetectKind ¶
func (r *Resolver) DetectKind(s reflectshape.Shape) Kind
func (*Resolver) NewPackageFromInterface ¶
func (*Resolver) Shape ¶
func (r *Resolver) Shape(ob interface{}) reflectshape.Shape
func (*Resolver) UnsafeShapeExtractor ¶
func (r *Resolver) UnsafeShapeExtractor() *reflectshape.Extractor
type StructFromShapeInfo ¶
func StructFromShape ¶
func StructFromShape(resolver *Resolver, fn reflectshape.Function) (reflectshape.Struct, StructFromShapeInfo, error)
type Tracker ¶
func NewTracker ¶
func (*Tracker) ExtractComponentFactoryShape ¶
func (t *Tracker) ExtractComponentFactoryShape(x Item) reflectshape.Shape
func (*Tracker) ExtractInterface ¶
func (*Tracker) ExtractMethodName ¶
Click to show internal directories.
Click to hide internal directories.