method

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyLocalOpts = LocalOpts{Context: map[string]bool{}}

Functions

func AvailableContextDebug added in v1.6.0

func AvailableContextDebug(required, available map[string]*xtype.Type) []string

Types

type Arg added in v1.6.0

type Arg struct {
	Name string
	Use  ArgUse
	Type *xtype.Type
}

type ArgUse added in v1.6.0

type ArgUse string
const (
	ArgUseSource      ArgUse = "source"
	ArgUseMultiSource ArgUse = "additional-source"
	ArgUseInterface   ArgUse = "interface"
	ArgUseContext     ArgUse = "context"
	ArgUseTarget      ArgUse = "target"
)

type Definition

type Definition struct {
	Parameters
	OriginID string
	Call     *jen.Statement
	ID       string
	Package  string
	Name     string

	Generated  bool
	CustomCall *jen.Statement
}

func Parse

func Parse(obj types.Object, opts *ParseOpts, localOpts LocalOpts) (*Definition, error)

Parse parses an function into a Definition.

func (*Definition) ArgDebug added in v1.6.0

func (def *Definition) ArgDebug(indent string) string

type Index added in v1.6.0

type Index[T any] struct {
	Exact  map[xtype.Signature][]IndexEntry[T]
	Update []*T
}

func NewIndex added in v1.6.0

func NewIndex[T any]() *Index[T]

func (*Index[T]) ByID added in v1.6.0

func (l *Index[T]) ByID(id IndexID) *T

func (*Index[T]) Get added in v1.6.0

func (l *Index[T]) Get(sig xtype.Signature, m map[string]*xtype.Type) (*T, error)

func (*Index[T]) GetAll added in v1.6.0

func (l *Index[T]) GetAll() []*T

func (*Index[T]) Has added in v1.6.0

func (l *Index[T]) Has(sig xtype.Signature) bool

func (*Index[T]) Register added in v1.6.0

func (l *Index[T]) Register(t *T, def *Definition) (IndexID, error)

func (*Index[T]) RegisterOverrideOverlapping added in v1.6.0

func (l *Index[T]) RegisterOverrideOverlapping(t *T, def *Definition)

func (*Index[T]) RegisterUpdate added in v1.6.0

func (l *Index[T]) RegisterUpdate(t *T, def *Definition) (IndexID, error)

type IndexEntry added in v1.6.0

type IndexEntry[T any] struct {
	Def  *Definition
	Item *T
}

type IndexID added in v1.6.0

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

type LocalOpts added in v1.7.0

type LocalOpts struct {
	Context map[string]bool
}

type ParamType added in v1.1.0

type ParamType int
const (
	ParamsRequired ParamType = iota
	ParamsOptional
	ParamsNone
)

type Parameters

type Parameters struct {
	TypeParams bool

	Source       *xtype.Type
	MultiSources []*xtype.Type
	Target       *xtype.Type
	Context      map[string]*xtype.Type

	Signature xtype.Signature

	RawArgs []Arg

	ReturnError  bool
	UpdateTarget bool
}

type ParseOpts

type ParseOpts struct {
	Location          string
	Converter         types.Type
	OutputPackagePath string

	ErrorPrefix       string
	Params            ParamType
	ParamsMultiSource bool
	AllowTypeParams   bool

	ContextMatch *regexp.Regexp

	Generated   bool
	CustomCall  *jen.Statement
	UpdateParam string
}

Jump to

Keyboard shortcuts

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