doc

package
v0.0.0-...-f17947f Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Overview

Package doc fetches Go package documentation from version control services.

Index

Constants

View Source
const PackageVersion = "8"

PackageVersion is modified when previously stored packages are invalid.

Variables

This section is empty.

Functions

func SetDefaultGOOS

func SetDefaultGOOS(goos string)

SetDefaultGOOS sets given GOOS value as default one to use when building package documents. SetDefaultGOOS has no effect on some windows-only packages.

Types

type Annotation

type Annotation struct {
	Pos, End  int32
	Kind      AnnotationKind
	PathIndex int16
}

Annotation needs a comment

type AnnotationKind

type AnnotationKind int16

AnnotationKind needs a comment

const (
	// LinkAnnotation to export in package specified by Paths[PathIndex] with fragment
	// Text[strings.LastIndex(Text[Pos:End], ".")+1:End].
	LinkAnnotation AnnotationKind = iota

	// AnchorAnnotation with name specified by Text[Pos:End] or typeName + "." +
	// Text[Pos:End] for type declarations.
	AnchorAnnotation

	// CommentAnnotation needs a comment
	CommentAnnotation

	// PackageLinkAnnotation Link to package specified by Paths[PathIndex].
	PackageLinkAnnotation

	// BuiltinAnnotation Link to builtin entity with name Text[Pos:End].
	BuiltinAnnotation
)

type Code

type Code struct {
	Text        string
	Annotations []Annotation
	Paths       []string
}

Code needs a comment

type Example

type Example struct {
	Name   string
	Doc    string
	Code   Code
	Play   string
	Output string
}

Example needs a comment

type File

type File struct {
	Name string
	URL  string
}

File needs a comment

type Func

type Func struct {
	Decl     Code
	Pos      Pos
	Doc      string
	Name     string
	Recv     string // Actual receiver "T" or "*T".
	Orig     string // Original receiver "T" or "*T". This can be different from Recv due to embedding.
	Examples []*Example
}

Func needs a comment

type Note

type Note struct {
	Pos  Pos
	UID  string
	Body string
}

Note needs a comment

type Package

type Package struct {
	// The import path for this package.
	ImportPath string

	// Import path prefix for all packages in the project.
	ProjectRoot string

	// Name of the project.
	ProjectName string

	// Project home page.
	ProjectURL string

	// Errors found when fetching or parsing this package.
	Errors []string

	// Packages referenced in README files.
	References []string

	// Version control system: git, hg, bzr, ...
	VCS string

	// Version control: active or suppressed.
	Status gosrc.DirectoryStatus

	// Whether the package is a fork of another one.
	Fork bool

	// How many stars (for a GitHub project) or followers (for a BitBucket
	// project) the repository of this package has.
	Stars int

	// The time this object was created.
	Updated time.Time

	// Cache validation tag. This tag is not necessarily an HTTP entity tag.
	// The tag is "" if there is no meaningful cache validation for the VCS.
	Etag string

	// Subdirectories, possibly containing Go code.
	Subdirectories []string

	// Package name or "" if no package for this import path. The proceeding
	// fields are set even if a package is not found for the import path.
	Name string

	// Synopsis and full documentation for the package.
	Synopsis string
	Doc      string

	// Format this package as a command.
	IsCmd bool

	// True if package documentation is incomplete.
	Truncated bool

	// Environment
	GOOS, GOARCH string

	// Top-level declarations.
	Consts []*Value
	Funcs  []*Func
	Types  []*Type
	Vars   []*Value

	// Package examples
	Examples []*Example

	Notes map[string][]*Note

	// Source.
	LineFmt   string
	BrowseURL string
	Files     []*File
	TestFiles []*File

	// Source size in bytes.
	SourceSize     int
	TestSourceSize int

	// Imports
	Imports      []string
	TestImports  []string
	XTestImports []string
}

Package needs a comment

func Get

func Get(client *http.Client, importPath string, etag string) (*Package, error)

Get needs a comment

type Pos

type Pos struct {
	Line int32  // 0 if not valid.
	N    uint16 // number of lines - 1
	File int16  // index in Package.Files
}

Pos needs a comment

type Type

type Type struct {
	Doc      string
	Name     string
	Decl     Code
	Pos      Pos
	Consts   []*Value
	Vars     []*Value
	Funcs    []*Func
	Methods  []*Func
	Examples []*Example
}

Type needs a comment

type Value

type Value struct {
	Decl Code
	Pos  Pos
	Doc  string
}

Value needs a comment

Jump to

Keyboard shortcuts

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