golazy.dev
–
golazy.dev
/
lazydoc
Index
|
Files
package lazydoc
import "golazy.dev/lazydoc"
Types
type Example
type Example struct {
Name string `json:"name"`
Suffix string `json:"suffix,omitempty"`
Doc string `json:"doc,omitempty"`
Code string `json:"code"`
Output string `json:"output,omitempty"`
}
type Func
type Func struct {
Name string `json:"name"`
Doc string `json:"doc"`
Decl string `json:"decl"`
Examples []Example `json:"examples,omitempty"`
}
type Index
type Index struct {
Versions []Version `json:"versions"`
}
func LoadDir
func LoadDir(dir, version string) (*Index, error)
func LoadJSON
func LoadJSON(root fs.FS, file string) (*Index, error)
func LoadJSONBytes
func LoadJSONBytes(data []byte) (*Index, error)
func (i *Index) Latest
func (i *Index) Latest() (*Version, bool)
func (i *Index) Search
func (i *Index) Search(version, query string) []SearchResult
func (i *Index) Version
func (i *Index) Version(value string) (*Version, bool)
type Package
type Package struct {
ImportPath string `json:"import_path"`
Name string `json:"name"`
Synopsis string `json:"synopsis"`
Doc string `json:"doc"`
Constants []Value `json:"constants,omitempty"`
Variables []Value `json:"variables,omitempty"`
Functions []Func `json:"functions,omitempty"`
Types []Type `json:"types,omitempty"`
Examples []Example `json:"examples,omitempty"`
}
func LoadPackagesFromDir
func LoadPackagesFromDir(dir, modulePath string) ([]Package, error)
func (p Package) Slug
func (p Package) Slug() string
func (p Package) Symbol
func (p Package) Symbol(name string) (kind string, title string, doc string, decl string, ok bool)
type SearchResult
type SearchResult struct {
Version string
PackagePath string
PackageName string
Kind string
Name string
URL string
Summary string
}
type Type
type Type struct {
Name string `json:"name"`
Doc string `json:"doc"`
Decl string `json:"decl"`
Constants []Value `json:"constants,omitempty"`
Variables []Value `json:"variables,omitempty"`
Funcs []Func `json:"functions,omitempty"`
Methods []Func `json:"methods,omitempty"`
Examples []Example `json:"examples,omitempty"`
}
type Value
type Value struct {
Names []string `json:"names"`
Doc string `json:"doc"`
Decl string `json:"decl"`
}
type Version
type Version struct {
Version string `json:"version"`
Module string `json:"module"`
Packages []Package `json:"packages"`
}
func (v *Version) Package
func (v *Version) Package(pathValue string) (*Package, bool)