doc

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2014 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GOPM_FILE_NAME     = ".gopmfile"
	GOPM_CONFIG_FILE   = "data/gopm.ini"
	PKG_NAME_LIST_PATH = "data/pkgname.list"
	VER_PATH           = "data/VERSION.json"
	RawHomeDir         = "~/.gopm"
)
View Source
const (
	TRUNK   = "trunk"
	MASTER  = "master"
	DEFAULT = "default"
	TAG     = "tag"
	BRANCH  = "branch"
	COMMIT  = "commit"
	LOCAL   = "local"
)
View Source
const VENDOR = ".vendor"

Variables

View Source
var (
	HomeDir        = "~/.gopm"
	LocalNodesFile = "/data/localnodes.list"
	LocalNodes     *goconfig.ConfigFile
	Cfg            *goconfig.ConfigFile
)
View Source
var (
	HttpClient = &http.Client{Transport: httpTransport}
)
View Source
var PackageNameList map[string]string

Functions

func CheckImports

func CheckImports(absPath, importPath string, nod *Node) (importPkgs []string, err error)

checkImports checks package denpendencies.

func CheckIsExistInGOPATH

func CheckIsExistInGOPATH(importPath string) (string, bool)

CheckIsExistInGOPATH checks if given package import path exists in any path in GOPATH/src, and returns corresponding GOPATH.

func CheckIsExistWithVCS

func CheckIsExistWithVCS(path string) bool

CheckIsExistWithVCS returns false if directory only has VCS folder, or doesn't exist.

func CheckNodeValue

func CheckNodeValue(v string) string

func GetAllImports

func GetAllImports(dirs []string, importPath string, example, test bool) (imports []string)

GetAllImports returns all imports in given directory and all sub-directories.

func GetBestMatchGOPATH

func GetBestMatchGOPATH(appPath string) string

GetGOPATH returns best matched GOPATH.

func GetDirsInfo

func GetDirsInfo(rootPath string) ([]os.FileInfo, error)

GetDirsInfo returns os.FileInfo of all sub-directories in root path.

func GetGithubCredentials

func GetGithubCredentials() string

func GetImports

func GetImports(absPath, importPath string, example, test bool) []string

GetImports returns package denpendencies.

func GetPkgFullPath

func GetPkgFullPath(short string) string

func GetProjectPath

func GetProjectPath(importPath string) (projectPath string)

GetProjectPath returns project path of import path.

func IsGoRepoPath

func IsGoRepoPath(importPath string) bool

IsGoRepoPath returns true if package is from standard library.

func IsValidRemotePath

func IsValidRemotePath(importPath string) bool

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

func LoadLocalNodes

func LoadLocalNodes()

func LoadPkgNameList

func LoadPkgNameList(filePath string)

func NewGopmfile

func NewGopmfile(dirPath string) *goconfig.ConfigFile

NewGopmfile loads gopmgile in given directory.

func PureDownload

func PureDownload(nod *Node, installRepoPath string, ctx *cli.Context) ([]string, error)

PureDownload downloads package without version control.

func SaveLocalNodes

func SaveLocalNodes()

func SetAppConfig

func SetAppConfig(path string, backup bool)

func Synopsis

func Synopsis(s string) string

Synopsis extracts the first sentence from s. All runs of whitespace are replaced by a single space.

Types

type Context

type Context struct {
	build.Context
	// contains filtered or unexported fields
}

type Node

type Node struct {
	Pkg
	DownloadURL   string
	Synopsis      string
	IsGetDeps     bool
	IsGetDepsOnly bool
	Revision      string
}

func NewNode

func NewNode(importPath, downloadUrl, tp, value string, isGetDeps bool) *Node

type Pkg

type Pkg struct {
	ImportPath string
	RootPath   string
	Type       string
	Value      string // Branch, tag, commit or local.
}

func NewDefaultPkg

func NewDefaultPkg(importPath string) *Pkg

func NewPkg

func NewPkg(importPath, tp, value string) *Pkg

func (*Pkg) IsFixed

func (pkg *Pkg) IsFixed() bool

If the package is fixed and no need to updated. For commit, tag and local, it's fixed. For branch

func (*Pkg) VerString

func (pkg *Pkg) VerString() string

type Source

type Source struct {
	SrcName string
	SrcData []byte
}

A Source describles a Source code file.

func (*Source) Data

func (s *Source) Data() []byte

func (*Source) IsDir

func (s *Source) IsDir() bool

func (*Source) ModTime

func (s *Source) ModTime() time.Time

func (*Source) Mode

func (s *Source) Mode() os.FileMode

func (*Source) Name

func (s *Source) Name() string

func (*Source) Size

func (s *Source) Size() int64

func (*Source) Sys

func (s *Source) Sys() interface{}

Jump to

Keyboard shortcuts

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