dypl

package module
v0.0.0-...-a8f9acb Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 6 Imported by: 0

README

struct-mapper

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound    = errors.New("not found")
	ErrIsNotFunc   = errors.New("value is not a function")
	ErrIsNotStruct = errors.New("value is not a struct")
)

Functions

func AnyToAny

func AnyToAny[T any](args ...T) []any

func AnyToValue

func AnyToValue[T any](args []T) []reflect.Value

Types

type Func

type Func struct {
	ExpIn, ExpOut []reflect.Type
	// contains filtered or unexported fields
}

func NewFunc

func NewFunc(f reflect.Value) (*Func, error)

func (*Func) Call

func (f *Func) Call(args ...reflect.Value) []reflect.Value

func (*Func) String

func (f *Func) String() string

type Method

type Method struct {
	ExpIn, ExpOut []reflect.Type
	// contains filtered or unexported fields
}

func (Method) String

func (m Method) String() string

type PluginManager

type PluginManager struct {
	// contains filtered or unexported fields
}

func LoadPlugins

func LoadPlugins(path string) (*PluginManager, error)

func (*PluginManager) GetFunc

func (pm *PluginManager) GetFunc(pName, funcName string) (*Func, error)

func (*PluginManager) GetPlugin

func (pm *PluginManager) GetPlugin(name string) (*plugin.Plugin, error)

func (*PluginManager) GetStruct

func (pm *PluginManager) GetStruct(pName, sName string) (*Struct, error)

func (*PluginManager) GetSymbol

func (pm *PluginManager) GetSymbol(pName, symName string) (plugin.Symbol, error)

func (*PluginManager) GetValue

func (pm *PluginManager) GetValue(pName, symName string) (reflect.Value, error)

func (*PluginManager) ListPlugins

func (pm *PluginManager) ListPlugins() []string

type Struct

type Struct struct {
	Receiver reflect.Value
	// contains filtered or unexported fields
}

func NewStruct

func NewStruct(recv reflect.Value) (*Struct, error)

func (*Struct) Call

func (s *Struct) Call(name string, args ...any) ([]reflect.Value, error)

func (*Struct) GetField

func (s *Struct) GetField(name string) (reflect.Value, error)

func (*Struct) GetMethod

func (s *Struct) GetMethod(name string) (Method, error)

func (*Struct) ListFields

func (s *Struct) ListFields() []string

func (*Struct) ListMethods

func (s *Struct) ListMethods() []string

func (*Struct) String

func (s *Struct) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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