gen

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColourWhite string = "#ffffff"

	ColourName            string = "#1c1c1c"
	ColourEmbedded        string = "#1f38b5"
	ColourFieldType       string = "#1f38b5"
	ColourMethodSignature string = "#1f38b5"
	ColourFuncSignature   string = "#1f38b5"

	ColourType      string = "#6d8cbf"
	ColourPrimitive string = "#74b1b5"
	ColourComposite string = "#739e78"
	ColourPointer   string = "#fa6d57"
	ColourStruct    string = "#b5558d"
	ColourInterface string = "#e4f58e"
	ColourVar       string = "#edb4ab"
	ColourConst     string = "#c5bfdb"
	ColourFunc      string = "#dbcb8f"
	ColourExternal  string = "#999999"
)

Variables

View Source
var (
	// ErrPkg a common package error.
	ErrPkg = errors.New("gen")
	// ErrTemplateParse error.
	ErrTemplateParse = fmt.Errorf("%w: unable to parse a template", ErrPkg)
	// ErrTemplateExecute error.
	ErrTemplateExecute = fmt.Errorf("%w: unable to execute a template renderer", ErrPkg)
)

Functions

This section is empty.

Types

type DefaultDepGraphGenerator

type DefaultDepGraphGenerator struct{}

DefaultDepGraphGenerator default generator implementation.

func NewDepGraphGenerator

func NewDepGraphGenerator() *DefaultDepGraphGenerator

NewDepGraphGenerator factory function.

func (*DefaultDepGraphGenerator) Generate

func (g *DefaultDepGraphGenerator) Generate(packages *imports.Packages) (string, error)

Generate generate dependency graph.

type DefaultUMLGraphGenerator

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

DefaultUMLGraphGenerator default generator implementation.

func NewDefaultUMLGraphGenerator

func NewDefaultUMLGraphGenerator(options ...UMLGraphGeneratorOption) *DefaultUMLGraphGenerator

NewDefaultUMLGraphGenerator factory function.

func (*DefaultUMLGraphGenerator) Generate

func (g *DefaultUMLGraphGenerator) Generate() (string, error)

Generate generate UML diagram.

type DepGraphGenerator

type DepGraphGenerator interface {
	Generate(packages *imports.Packages) (string, error)
}

DepGraphGenerator generate dependency graph.

type TypeInfoParts

type TypeInfoParts struct {
	Name, PackagePath string
}

TypeInfoParts to represent parsed type info.

type UMLGraphGenerator

type UMLGraphGenerator interface {
	Generate() (string, error)
}

UMLGraphGenerator generate UML diagram.

type UMLGraphGeneratorConfig

type UMLGraphGeneratorConfig struct {
	Legend, Primitive, Var, Const, Func, NotExported, Doc bool
}

UMLGraphGeneratorConfig configuration.

type UMLGraphGeneratorOption

type UMLGraphGeneratorOption func(p *DefaultUMLGraphGenerator)

UMLGraphGeneratorOption option function.

func WithUMLGraphGeneratorCodeMap

func WithUMLGraphGeneratorCodeMap(
	codeMap *parser.CodeMap[*parser.Var, *parser.Type, *parser.Func, *parser.Const],
) UMLGraphGeneratorOption

WithUMLGraphGeneratorCodeMap configuration option.

func WithUMLGraphGeneratorConfig

func WithUMLGraphGeneratorConfig(config *UMLGraphGeneratorConfig) UMLGraphGeneratorOption

WithUMLGraphGeneratorConfig configuration option.

Jump to

Keyboard shortcuts

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