gddo: Index | Files

package doc

import ""

Package doc fetches Go package documentation from version control services.


Package Files

bitbucket.go builder.go code.go get.go github.go google.go launchpad.go local.go path.go present.go util.go vcs.go vet.go


const PackageVersion = "6"

PackageVersion is modified when previously stored packages are invalid.


var (
    ErrNotModified = errors.New("package not modified")

func IsGoRepoPath Uses

func IsGoRepoPath(importPath string) bool

func IsNotFound Uses

func IsNotFound(err error) bool

func IsValidPath Uses

func IsValidPath(importPath string) bool

func IsValidRemotePath Uses

func IsValidRemotePath(importPath string) bool

IsValidRemotePath returns true if importPath is structurally valid for "go get".

func SetGithubCredentials Uses

func SetGithubCredentials(id, secret string)

func SetUserAgent Uses

func SetUserAgent(ua string)

type Annotation Uses

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

type AnnotationKind Uses

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

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

    // Comment.

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

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

type Code Uses

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

type Example Uses

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

type File Uses

type File struct {
    Name string
    URL  string

type Func Uses

type Func struct {
    Decl     Code
    Pos      Pos
    Doc      string
    Name     string
    Recv     string
    Examples []*Example

type HttpClient Uses

type HttpClient interface {
    Do(req *http.Request) (*http.Response, error)

type NotFoundError Uses

type NotFoundError struct {
    Message string

func (NotFoundError) Error Uses

func (e NotFoundError) Error() string

type Note Uses

type Note struct {
    Pos  Pos
    UID  string
    Body string

type Package Uses

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

    // 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

    // 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 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
    Bugs  []string

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

    // Source size in bytes.
    SourceSize     int
    TestSourceSize int

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

    // The number of stargazers/watchers
    StarCount int
    // Filename and content of readme.* files
    ReadmeFiles map[string][]byte

func Get Uses

func Get(client HttpClient, importPath string, etag string) (pdoc *Package, err error)

func GetLocal Uses

func GetLocal(importPath string, goroot, gopath string, browseURLFmt, lineFmt string) (*Package, error)

GetLocal gets the documentation from the localy installed

type Person Uses

type Person struct {
    Projects []string

func GetBitbucketPerson Uses

func GetBitbucketPerson(client HttpClient, match map[string]string) (*Person, error)

func GetGithubPerson Uses

func GetGithubPerson(client HttpClient, match map[string]string) (*Person, error)

type Pos Uses

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

type Presentation Uses

type Presentation struct {
    Filename string
    Files    map[string][]byte
    Updated  time.Time

func GetPresentation Uses

func GetPresentation(client HttpClient, importPath string) (*Presentation, error)

GetPresentation gets a presentation from the the given path.

type RemoteError Uses

type RemoteError struct {
    Host string
    // contains filtered or unexported fields

func (*RemoteError) Error Uses

func (e *RemoteError) Error() string

type Type Uses

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

type Value Uses

type Value struct {
    Decl Code
    Pos  Pos
    Doc  string

Package doc imports 34 packages (graph) and is imported by 34 packages. Updated 2016-07-19. Refresh now. Tools for package owners.