godoc

package
v0.0.0-...-55358d4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package godoc is for rendering Go documentation.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEncodingType = fmt.Errorf("want initial bytes to be %q but they aren't", fastEncodingType)

ErrInvalidEncodingType is returned when the data to DecodePackage has an invalid encoding type.

View Source
var TypesToGenerate = []any{&encPackage{}}

Used by the gen program to generate encodings for unexported types.

Functions

This section is empty.

Types

type File

type File struct {
	Name string // full file pathname relative to zip content directory
	AST  *ast.File
}

A File contains everything needed about a source file to render documentation.

type Package

type Package struct {
	Fset *token.FileSet
	// contains filtered or unexported fields
}

A Package contains package-level information needed to render Go documentation.

func DecodePackage

func DecodePackage(data []byte) (*Package, error)

DecodePackage decodes a byte slice encoded with Package.Encode into a Package.

func NewPackage

func NewPackage() *Package

NewPackage returns a new Package.

func (*Package) AddFile

func (p *Package) AddFile(f *ast.File, removeNodes bool)

AddFile adds a file to the Package. After it returns, the contents of the ast.File are unsuitable for anything other than the methods of this package.

func (*Package) Encode

func (p *Package) Encode() ([]byte, error)

Encode encodes a Package into a byte slice.

Directories

Path Synopsis
Package codec implements the general-purpose part of an encoder for Go values.
Package codec implements the general-purpose part of an encoder for Go values.

Jump to

Keyboard shortcuts

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