extract

package
Version: v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Overview

Package extract generates wrappers of package exported symbols.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMinor

func GetMinor(part string) string

GetMinor returns the minor part of the version number.

Types

type Extractor

type Extractor struct {
	Dest    string   // The name of the created package.
	License string   // License text to be included in the created package, optional.
	Exclude []string // Comma separated list of regexp matching symbols to exclude.
	Include []string // Comma separated list of regexp matching symbols to include.
	Tag     []string // Comma separated of build tags to be added to the created package.
}

Extractor creates a package with all the symbols from a dependency package.

func (*Extractor) Extract

func (e *Extractor) Extract(pkgIdent, importPath string, rw io.Writer) (string, error)

Extract writes to rw a Go package with all the symbols found at pkgIdent. pkgIdent can be an import path, or a local path, relative to e.WorkingDir. In the latter case, Extract returns the actual import path of the package found at pkgIdent, otherwise it just returns pkgIdent. If pkgIdent is an import path, it is looked up in GOPATH. Vendoring is not supported yet, and the behavior is only defined for GO111MODULE=off.

type Method

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

Method stores information for generating interface wrapper method.

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.

Source Files

Jump to

Keyboard shortcuts

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