docgen

package
v1.32.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0, MIT Imports: 43 Imported by: 3

Documentation

Index

Constants

View Source
const NoComment = "There are not yet any comments for this method."

Variables

View Source
var ExampleValues = map[reflect.Type]interface{}{
	reflect.TypeOf(api.MinerSubsystem(0)): api.MinerSubsystem(1),
	reflect.TypeOf(auth.Permission("")):   auth.Permission("write"),
	reflect.TypeOf(""):                    "string value",
	reflect.TypeOf(uint64(42)):            uint64(42),
	reflect.TypeOf(byte(7)):               byte(7),
	reflect.TypeOf([]byte{}):              []byte("byte array"),
}

Functions

func ExampleValue added in v1.9.0

func ExampleValue(method string, t, parent reflect.Type) interface{}

func Generate added in v1.30.0

func Generate(out io.Writer, iface, pkg string, ainfo ApiASTInfo) error

func GetAPIType added in v1.9.0

func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type)

func MethodGroupFromName added in v1.9.0

func MethodGroupFromName(mn string) string

Types

type ApiASTInfo added in v1.30.0

type ApiASTInfo struct {
	Comments      map[string]string
	GroupComments map[string]string
}

func ParseApiASTInfo added in v1.9.0

func ParseApiASTInfo(apiFile, iface, pkg, dir string) (ApiASTInfo, error)

type Method

type Method struct {
	Comment         string
	Name            string
	InputExample    string
	ResponseExample string
}

type MethodGroup

type MethodGroup struct {
	GroupName string
	Header    string
	Methods   []*Method
}

type Visitor

type Visitor struct {
	Root    string
	Methods map[string]ast.Node
}

func (*Visitor) Visit

func (v *Visitor) Visit(node ast.Node) ast.Visitor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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