docgen

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package docgen provides auto-generation of model documentation from Go types. It uses reflection to introspect struct fields and generate markdown documentation suitable for users who want to understand the data model for custom integrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	Name        string
	Type        string
	Path        string
	Tags        FieldTags
	IsOptional  bool
	IsNested    bool
	NestedType  string
	Description string
}

FieldInfo represents documentation for a single struct field.

type FieldTags

type FieldTags struct {
	JSON string
	YAML string
	XML  string
}

FieldTags holds the extracted tag values for a struct field.

type Generator

type Generator struct{}

Generator creates documentation from Go types using reflection.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new documentation generator.

func (*Generator) GenerateReference

func (g *Generator) GenerateReference(v any) string

GenerateReference generates markdown documentation for the given value's type.

func (*Generator) GenerateReferenceWithPrefix

func (g *Generator) GenerateReferenceWithPrefix(v any, prefix string) string

GenerateReferenceWithPrefix generates markdown documentation with a path prefix.

Jump to

Keyboard shortcuts

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