extract

package
v0.0.0-...-3fb485c Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package extract generates wrappers of package exported symbols.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenContent

func GenContent(
	destPath,
	destPkg, importPath string,
	p *types.Package,
	setFuncs map[string]bool,
	needsPublicType map[string]PublicType,
	imports *ImportTracker,
) ([]byte, error)

func GetMinor

func GetMinor(part string) string

GetMinor returns the minor part of the version number.

Types

type FieldAccessor

type FieldAccessor struct {
	*types.Var
	RType     string // receiver name
	AddrName  string // name of get-its-address func
	FieldType string // name of type of field
}

type ImportTracker

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

func NewImportTracker

func NewImportTracker(name, path string) *ImportTracker

func (*ImportTracker) GetAlias

func (it *ImportTracker) GetAlias(name, path string) (retS string)

func (*ImportTracker) NoImport

func (it *ImportTracker) NoImport(name, path string)

type Method

type Method struct {
	Name, Param, Result, Arg, Ret string
}

Method stores information for generating interface wrapper method.

type PublicType

type PublicType struct {
	Pkg  string
	Name string
}

type Val

type Val struct {
	Name string // "package.name"
	Addr bool   // true if symbol is a Var
}

Val stores the value name and addressable status of symbols.

type Wrap

type Wrap struct {
	Name   string
	Method []Method
}

Wrap stores information for generating interface wrapper.

Jump to

Keyboard shortcuts

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