ztree

package
v0.0.0-...-e6b4aba Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(name string, tree Tree) []byte

func WithDocFunc

func WithDocFunc(v func(p reflect.Type, field string) string) func(*Option)

func WithExpandPackages

func WithExpandPackages(v []interface{}) func(*Option)

func WithExpandTypes

func WithExpandTypes(v []interface{}) func(*Option)

func WithUnexported

func WithUnexported(v bool) func(*Option)

Types

type Option

type Option struct {
	ExpandPackages []interface{}
	ExpandTypes    []interface{}
	Unexported     bool
	DocFunc        func(p reflect.Type, field string) string
}

+zz:option

type Tree

type Tree struct {
	Values []Value `json:"values"`
	Types  []Type  `json:"types"`
}

+zz:tag:json:{{ snake .FieldName }}

func Parse

func Parse(v interface{}, opts ...func(*Option)) (tree Tree)

type Type

type Type struct {
	Id       string            `json:"id"`
	Kind     string            `json:"kind"`
	Package  string            `json:"package"`
	Name     string            `json:"name"`
	String   string            `json:"string"`
	Elements map[string]string `json:"elements"`
	Docs     map[string]string `json:"docs"`
}

+zz:tag:json:{{ snake .FieldName }}

func (Type) Fullname

func (typ Type) Fullname() string

type Value

type Value struct {
	Id       string            `json:"id"`
	Type     string            `json:"type"`
	Referred int               `json:"referred"`
	Elements map[string]string `json:"elements"`
	Flags    map[string]int    `json:"flags"`
}

+zz:tag:json:{{ snake .FieldName }}

Jump to

Keyboard shortcuts

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