Documentation
¶
Overview ¶
Package parser provides utilities for extracting SDK documentation from Go source files using go/ast, go/parser, and go/token.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldDescription ¶
type FieldDescription struct {
Name string `json:"name"`
Description string `json:"description"`
JSONTag string `json:"json_tag,omitempty"`
}
FieldDescription holds documentation for a struct field
type MethodDescription ¶
type MethodDescription struct {
ShortDescription string `json:"short_description"`
LongDescription string `json:"long_description"`
Parameters []ParameterDescription `json:"parameters,omitempty"`
}
MethodDescription holds documentation for a method
type ParameterDescription ¶
type ParameterDescription struct {
Name string `json:"name"`
Description string `json:"description"`
}
ParameterDescription holds documentation for a parameter
type SDKDescriptions ¶
type SDKDescriptions struct {
Services map[string]ServiceDescriptions `json:"services"`
Types map[string]TypeDescription `json:"types,omitempty"` // Global types
}
SDKDescriptions holds all service descriptions
func ExtractDescriptions ¶
func ExtractDescriptions(sdkPath string) (*SDKDescriptions, error)
ExtractDescriptions extracts method and parameter descriptions from SDK source files
func LoadFromFile ¶
func LoadFromFile(filePath string) (*SDKDescriptions, error)
LoadFromFile loads descriptions from a JSON file
func (*SDKDescriptions) SaveToFile ¶
func (d *SDKDescriptions) SaveToFile(filePath string) error
SaveToFile saves descriptions to a JSON file
type ServiceDescriptions ¶
type ServiceDescriptions struct {
ServiceName string `json:"service_name"`
ServiceDescription string `json:"service_description"`
Methods map[string]MethodDescription `json:"methods"`
Types map[string]TypeDescription `json:"types,omitempty"`
}
ServiceDescriptions holds all descriptions for a service
type TypeDescription ¶
type TypeDescription struct {
TypeName string `json:"type_name"`
Description string `json:"description,omitempty"`
Fields map[string]FieldDescription `json:"fields,omitempty"`
}
TypeDescription holds documentation for a type (struct)