genapi

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMarkdown

func WriteMarkdown(w io.Writer, pkg *Package, options ...Option) error

WriteMarkdown writes the API of pkg as markdown to w.

Types

type Constant added in v0.4.0

type Constant struct {
	Name   string
	Doc    string
	Values []Value
}

A Constant represents a constant.

type Field

type Field struct {
	Name     string
	Doc      string
	Type     types.Type
	Required bool
}

A Field represents a struct field.

type Option added in v0.4.0

type Option interface {
	// contains filtered or unexported methods
}

An Option applies an option.

func WithGroupVersion added in v0.5.0

func WithGroupVersion(gv schema.GroupVersion) Option

WithGroupVersion returns an option that sets the GroupVersion.

func WithScheme added in v0.4.0

func WithScheme(scheme *runtime.Scheme) Option

WithScheme returns an option that sets the scheme.

type Package

type Package struct {
	Pkg     *packages.Package
	AstPkg  *ast.Package
	DocPkg  *doc.Package
	FileSet *token.FileSet

	Constants map[string]Constant
	Structs   map[string]Struct
}

A Package represents a package.

func ParsePackage added in v0.4.0

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

ParsePackage parses the package in the given path.

type Struct

type Struct struct {
	Name   string
	Doc    string
	Type   types.Type
	Fields []Field
}

A Struct represents a struct.

type Value added in v0.4.0

type Value struct {
	Doc   string
	Name  string
	Value constant.Value
}

A Value represents a constant value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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