generator

package
v0.0.0-...-a89133e Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	BuildPackage *build.Package
	Doc          *doc.Package
	TypedValue   map[*doc.Value]bool // Consts and vars related to types.
	Constructor  map[*doc.Func]bool  // Constructors.
	FS           *token.FileSet      // Needed for printing.
	Path         string
}

func NewPackage

func NewPackage(path string) (*Package, error)

NewPackage turns the build package we found into a parsed package we can then use to generate documentation.

func (*Package) Emit

func (pkg *Package) Emit(node ast.Node) (string, error)

Emit prints the node. If showSrc is true, it ignores the provided comment, assuming the comment is in the node itself. Otherwise, the go/doc package clears the stuff we don't want to print anyway. It's a bit of a magic trick.

func (*Package) OneLineNode

func (pkg *Package) OneLineNode(node ast.Node) string

OneLineNode returns a one-line summary of the given input node.

Jump to

Keyboard shortcuts

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