Documentation ¶
Index ¶
- Constants
- Variables
- func CheckImports(absPath, importPath string, nod *Node) (importPkgs []string, err error)
- func CheckIsExistInGOPATH(importPath string) (string, bool)
- func CheckIsExistWithVCS(path string) bool
- func CheckNodeValue(v string) string
- func GetAllImports(dirs []string, importPath string, example, test bool) (imports []string)
- func GetBestMatchGOPATH(appPath string) string
- func GetDirsInfo(rootPath string) ([]os.FileInfo, error)
- func GetGithubCredentials() string
- func GetImports(absPath, importPath string, example, test bool) []string
- func GetPkgFullPath(short string) string
- func GetProjectPath(importPath string) (projectPath string)
- func IsGoRepoPath(importPath string) bool
- func IsValidRemotePath(importPath string) bool
- func LoadLocalNodes()
- func LoadPkgNameList(filePath string)
- func NewGopmfile(dirPath string) *goconfig.ConfigFile
- func PureDownload(nod *Node, installRepoPath string, ctx *cli.Context) ([]string, error)
- func SaveLocalNodes()
- func SetAppConfig(path string, backup bool)
- func Synopsis(s string) string
- type Context
- type Node
- type Pkg
- type Source
Constants ¶
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" )
const ( TRUNK = "trunk" MASTER = "master" DEFAULT = "default" TAG = "tag" BRANCH = "branch" COMMIT = "commit" LOCAL = "local" )
const VENDOR = ".vendor"
Variables ¶
var ( HomeDir = "~/.gopm" LocalNodesFile = "/data/localnodes.list" LocalNodes *goconfig.ConfigFile Cfg *goconfig.ConfigFile )
var (
HttpClient = &http.Client{Transport: httpTransport}
)
var PackageNameList map[string]string
Functions ¶
func CheckImports ¶
checkImports checks package denpendencies.
func CheckIsExistInGOPATH ¶
CheckIsExistInGOPATH checks if given package import path exists in any path in GOPATH/src, and returns corresponding GOPATH.
func CheckIsExistWithVCS ¶
CheckIsExistWithVCS returns false if directory only has VCS folder, or doesn't exist.
func CheckNodeValue ¶
func GetAllImports ¶
GetAllImports returns all imports in given directory and all sub-directories.
func GetBestMatchGOPATH ¶
GetGOPATH returns best matched GOPATH.
func GetDirsInfo ¶
GetDirsInfo returns os.FileInfo of all sub-directories in root path.
func GetGithubCredentials ¶
func GetGithubCredentials() string
func GetImports ¶
GetImports returns package denpendencies.
func GetPkgFullPath ¶
func GetProjectPath ¶
GetProjectPath returns project path of import path.
func IsGoRepoPath ¶
IsGoRepoPath returns true if package is from standard library.
func IsValidRemotePath ¶
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 ¶
PureDownload downloads package without version control.
func SaveLocalNodes ¶
func SaveLocalNodes()
func SetAppConfig ¶
Types ¶
type Node ¶
type Pkg ¶
type Pkg struct { ImportPath string RootPath string Type string Value string // Branch, tag, commit or local. }