Documentation ¶
Overview ¶
Package action provides implementations for every Gopkg command.
This is not a general-purpose library. It is the main flow controller for Gopkg.
The main gopkg package acts as a Facade, with this package providing the implementation. This package should know nothing of the command line flags or runtime characteristics. However, this package is allowed to control the flow of the application, including termination. So actions may call `msg.Die()` to immediately stop execution of the program.
In general, actions are not required to function as library functions, nor as concurrency-safe functions.
Index ¶
- func About()
- func CacheClear()
- func ConfigWizard(base string)
- func Create(base string, skipImport, nonInteractive bool)
- func Debug(on bool)
- func EnsureConfig() *cfg.Config
- func EnsureGoVendor()
- func EnsureGopath() string
- func EnsureVendorDir()
- func Get(names []string, installer *repo.Installer, ...)
- func ImportGB(dest string)
- func ImportGPM(dest string)
- func ImportGodep(dest string)
- func ImportGom(dest string)
- func Info(format string)
- func Init(yaml, home string)
- func Install(installer *repo.Installer, stripVendor bool)
- func List(basedir string, deep bool, format string)
- func MirrorsList() error
- func MirrorsRemove(k string) error
- func MirrorsSet(o, r, v string) error
- func Name()
- func NoColor(on bool)
- func NoVendor(path string, onlyGo, suffix bool)
- func Plugin(command string, args []string)
- func Quiet(on bool)
- func Rebuild()
- func Remove(packages []string, inst *repo.Installer)
- func Tree(basedir string, showcore bool)
- func Update(installer *repo.Installer, skipRecursive, stripVendor bool)
- type PackageList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigWizard ¶
func ConfigWizard(base string)
ConfigWizard reads configuration from a gopkg.yaml file and attempts to suggest improvements. The wizard is interactive.
func Create ¶
Create creates/initializes a new Gopkg repository.
This will fail if a gopkg.yaml already exists.
By default, this will scan the present source code directory for dependencies.
If skipImport is set to true, this will not attempt to import from an existing GPM, Godep, or GB project if one should exist. However, it will still attempt to read the local source to determine required packages.
func EnsureConfig ¶
EnsureConfig loads and returns a config file.
Any error will cause an immediate exit, with an error printed to Stderr.
func EnsureGopath ¶
func EnsureGopath() string
EnsureGopath fails if GOPATH is not set, or if $GOPATH/src is missing.
Otherwise it returns the value of GOPATH.
func EnsureVendorDir ¶
func EnsureVendorDir()
EnsureVendorDir ensures that a vendor/ directory is present in the cwd.
func Get ¶
func Get(names []string, installer *repo.Installer, insecure, skipRecursive, stripVendor, nonInteract, testDeps bool)
Get fetches one or more dependencies and installs.
This includes resolving dependency resolution and re-generating the lock file.
func ImportGB ¶
func ImportGB(dest string)
ImportGB imports GB dependencies into the present gopkg config.
func Info ¶
func Info(format string)
Info prints information about a project based on a passed in format.
func Init ¶
func Init(yaml, home string)
Init initializes the action subsystem for handling one or more subesequent actions.
func List ¶
List lists all of the dependencies of the current project.
Params:
- dir (string): basedir
- deep (bool): whether to do a deep scan or a shallow scan
- format (string): The format to output (text, json, json-pretty)
func NoVendor ¶
NoVendor generates a list of source code directories, excepting `vendor/`.
If "onlyGo" is true, only folders that have Go code in them will be returned.
If suffix is true, this will append `/...` to every directory.
func Plugin ¶
Plugin attempts to find and execute a plugin based on a command.
Exit code 99 means the plugin was never executed. Code 1 means the program exited badly.
func Rebuild ¶
func Rebuild()
Rebuild rebuilds '.a' files for a project.
Prior to Go 1.4, this could substantially reduce time on incremental compiles. It remains to be seen whether this is tremendously beneficial to modern Go programs.
Types ¶
type PackageList ¶
type PackageList struct { Installed []string `json:"installed"` Missing []string `json:"missing"` Gopath []string `json:"gopath"` }
PackageList contains the packages being used by their location