resolver

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package resolver provides the ability to locate and document go source packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	Type DocType `json:"type"`

	Name        string `json:"name"`
	Repository  string `json:"repository"`
	Header      string `json:"header"`
	Import      string `json:"import"`
	Declaration string `json:"declaration"`
	Usage       string `json:"usage"`

	Constants string `json:"constants"`
	Variables string `json:"variables"`
	Content   []Doc  `json:"content"`

	HasTravis bool `json:"hasTravis"`
}

Doc represents documentation for a function, type, or package.

type DocType

type DocType string

DocType defines a type of documentation.

const (
	// PackageDoc indicates package-level documentation.
	PackageDoc DocType = "PACKAGE"
	// FunctionDoc indicates function-level documentation.
	FunctionDoc DocType = "FUNCTION"
	// TypeDoc indicates type-level documentation.
	TypeDoc DocType = "TYPE"
)

type Package

type Package struct {
	depth.Pkg

	Docs *Doc `json:"docs"`
	// contains filtered or unexported fields
}

Package represents a go source package.

func NewPackage

func NewPackage(path string) (*Package, error)

NewPackage attempts to resolve a go package from the path provided.

The path can be either the absolute path (ex. /foo/bar/package) or the import path (ex. github.com/foo/bar).

type Resolver

type Resolver struct{}

Resolver is a type that can access go packages and resolve their details.

func (Resolver) Details

func (Resolver) Details(name string) (*Package, error)

Details returns the full details of a Package.

func (Resolver) List

func (r Resolver) List() ([]*Package, error)

List returns a list of all packages in the $GOPATH.

Jump to

Keyboard shortcuts

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