Documentation ¶
Overview ¶
Package bind provides tools to generate bindings to use Go from Python.
Index ¶
- func GenCFFI(w io.Writer, fset *token.FileSet, pkg *Package, vm string, lang int) error
- func GenCPython(w io.Writer, fset *token.FileSet, pkg *Package, vm string, lang int) error
- func GenGo(w io.Writer, fset *token.FileSet, pkg *Package, lang int, vm, capi string) error
- type Const
- type ErrorList
- type Func
- type Object
- type Package
- type Protocol
- type Signature
- type Struct
- type Type
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenCFFI ¶
GenCFFI generates a CFFI package from a Go package Use 4spaces indentation for Python codes, aka PEP8. w is an io.Writer for a wrapper python script which will be executed by a user.
GenCFFI generates a wrapper python script by 2 steps. First, GenCFFI analyzes which interfaces should be exposed from the Go package. Then, GenCFFI writes a wrapper python script.
func GenCPython ¶
GenCPython generates a (C)Python package from a Go package
Types ¶
type Func ¶
type Func struct {
// contains filtered or unexported fields
}
Func collects informations about a go func/method.
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package ties types.Package and ast.Package together. Package also collects informations about structs and funcs.
func NewPackage ¶
NewPackage creates a new Package, tying types.Package and ast.Package together.
func (*Package) ImportPath ¶
ImportPath returns the package import path.
type Protocol ¶
type Protocol int
Protocol encodes the various protocols a python type may implement
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
A Signature represents a (non-builtin) function or method type.
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
Struct collects informations about a go struct.