bpdoc

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollapseDuplicateProperties

func CollapseDuplicateProperties(to, from *[]Property)

Types

type ModuleType

type ModuleType struct {
	// Name is the string that will appear in Blueprints files when defining a new module of
	// this type.
	Name string

	// PkgPath is the full package path of the package that contains the module type factory.
	PkgPath string

	// Text is the contents of the comment documenting the module type.
	Text template.HTML

	// PropertyStructs is a list of PropertyStruct objects that contain information about each
	// property struct that is used by the module type, containing all properties that are valid
	// for the module type.
	PropertyStructs []*PropertyStruct
}

ModuleType contains the information about a module type that is relevant to generating documentation.

type Package

type Package struct {
	// Name is the name of the package.
	Name string

	// Path is the full package path of the package as used in the primary builder.
	Path string

	// Text is the contents of the package comment documenting the module types in the package.
	Text string

	// ModuleTypes is a list of ModuleType objects that contain information about each module type that is
	// defined by the package.
	ModuleTypes []*ModuleType
}

Package contains the information about a package relevant to generating documentation.

func AllPackages

func AllPackages(pkgFiles map[string][]string, moduleTypeNameFactories map[string]reflect.Value,
	moduleTypeNamePropertyStructs map[string][]interface{}) ([]*Package, error)

type Property

type Property struct {
	Name       string
	OtherNames []string
	Type       string
	Tag        reflect.StructTag
	Text       template.HTML
	OtherTexts []template.HTML
	Properties []Property
	Default    string
}

func (*Property) Clone

func (p *Property) Clone() Property

func (*Property) Equal

func (p *Property) Equal(other Property) bool

func (*Property) Nest

func (p *Property) Nest(nested *PropertyStruct)

func (*Property) SameSubProperties

func (p *Property) SameSubProperties(other Property) bool

type PropertyStruct

type PropertyStruct struct {
	Name       string
	Text       string
	Properties []Property
}

func (*PropertyStruct) Clone

func (ps *PropertyStruct) Clone() *PropertyStruct

func (*PropertyStruct) ExcludeByTag

func (ps *PropertyStruct) ExcludeByTag(key, value string)

func (*PropertyStruct) GetByName

func (ps *PropertyStruct) GetByName(name string) *Property

func (*PropertyStruct) IncludeByTag

func (ps *PropertyStruct) IncludeByTag(key, value string)

func (*PropertyStruct) SetDefaults

func (ps *PropertyStruct) SetDefaults(defaults reflect.Value)

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Handles parsing and low-level processing of Blueprint module source files. Note that most getter functions associated with Reader only fill basic information that can be simply extracted from AST parsing results. More sophisticated processing is performed in bpdoc.go

func NewReader

func NewReader(pkgFiles map[string][]string) *Reader

func (*Reader) ModuleType

func (r *Reader) ModuleType(name string, factory reflect.Value) (*ModuleType, error)

func (*Reader) Package

func (r *Reader) Package(path string) (*Package, error)

func (*Reader) PropertyStruct

func (r *Reader) PropertyStruct(pkgPath, name string, defaults reflect.Value) (*PropertyStruct, error)

Return the PropertyStruct associated with a property struct type. The type should be in the format <package path>.<type name>

Jump to

Keyboard shortcuts

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