core

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NUMBER = 280
View Source
const REVISION = "f1cf6698521d5b43da06f012ac3ba5afb1308d27+1"
View Source
const VERSION = "1.0.43"
View Source
const XGO_CHECK_TOOLCHAIN_VERSION = "XGO_CHECK_TOOLCHAIN_VERSION"
View Source
const XGO_NUMBER = 0
View Source
const XGO_REVISION = ""
View Source
const XGO_VERSION = ""

these fields will be filled by compiler, see CORE_VERSION in cmd/xgo/version.go

Variables

This section is empty.

Functions

func ParseFuncName

func ParseFuncName(fullName string) (pkgPath string, recvName string, recvPtr bool, typeGeneric string, funcGeneric string, funcName string)

a/b/c.A a/b/c.(*C).X a/b/c.C.Y a/b/c.Z a/b/c.Z[].X a/b/c.X[]

parse process:

funcGeneric
funcName
recvType
recvGeneric
pkgPath

Types

type Field

type Field interface {
	Name() string
	Value() interface{}
	Ptr() interface{}
	Set(val interface{})
}

type FuncInfo

type FuncInfo struct {
	// full name, format: {pkgPath}.{receiver}.{funcName}
	// example:  github.com/xhd2015/xgo/runtime/core.(*FuncInfo).IsFunc
	Kind         Kind
	FullName     string
	Pkg          string
	IdentityName string
	Name         string
	RecvType     string
	RecvPtr      bool

	// is this an interface method?
	Interface bool

	// is this a generic function?
	Generic bool

	// is this a closure?
	Closure bool

	// is this function from stdlib
	Stdlib bool

	// source info
	File string
	Line int

	PC   uintptr     `json:"-"`
	Func interface{} `json:"-"`
	Var  interface{} `json:"-"` // var address

	RecvName string
	ArgNames []string
	ResNames []string

	// is first argument ctx
	FirstArgCtx bool
	// last last result error
	LastResultErr bool
}

func (*FuncInfo) DisplayName

func (c *FuncInfo) DisplayName() string

type Kind

type Kind int
const (
	Kind_Func   Kind = 0
	Kind_Var    Kind = 1
	Kind_VarPtr Kind = 2
	Kind_Const  Kind = 3
)

func (Kind) String

func (c Kind) String() string

type Object

type Object interface {
	GetField(name string) Field
	GetFieldIndex(i int) Field
	NumField() int
}

type ObjectWithErr

type ObjectWithErr interface {
	Object

	GetErr() Field
}

Jump to

Keyboard shortcuts

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