action

package
v0.0.0-...-81b44d8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 26 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func About

func About()

About prints information about Gopkg.

func CacheClear

func CacheClear()

CacheClear clears the Gopkg cache

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

func Create(base string, skipImport, nonInteractive bool)

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 Debug

func Debug(on bool)

Debug sets the debugging flags across components.

func EnsureConfig

func EnsureConfig() *cfg.Config

EnsureConfig loads and returns a config file.

Any error will cause an immediate exit, with an error printed to Stderr.

func EnsureGoVendor

func EnsureGoVendor()

EnsureGoVendor ensures that the Go version is correct.

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 ImportGPM

func ImportGPM(dest string)

ImportGPM imports a GPM file.

func ImportGodep

func ImportGodep(dest string)

ImportGodep imports a Godep file.

func ImportGom

func ImportGom(dest string)

ImportGom imports a Gomfile.

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 Install

func Install(installer *repo.Installer, stripVendor bool)

Install installs a vendor directory based on an existing Gopkg configuration.

func List

func List(basedir string, deep bool, format string)

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 MirrorsList

func MirrorsList() error

MirrorsList displays a list of currently setup mirrors.

func MirrorsRemove

func MirrorsRemove(k string) error

MirrorsRemove removes a mirrors setting

func MirrorsSet

func MirrorsSet(o, r, v string) error

MirrorsSet sets a mirror to use

func Name

func Name()

Name prints the name of the package, according to the gopkg.yaml file.

func NoColor

func NoColor(on bool)

NoColor sets the color flags.

func NoVendor

func NoVendor(path string, onlyGo, suffix bool)

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

func Plugin(command string, args []string)

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 Quiet

func Quiet(on bool)

Quiet sets the quiet flags across components.

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.

func Remove

func Remove(packages []string, inst *repo.Installer)

Remove removes a dependncy from the configuration.

func Tree

func Tree(basedir string, showcore bool)

Tree prints a tree representing dependencies.

func Update

func Update(installer *repo.Installer, skipRecursive, stripVendor bool)

Update updates repos and the lock file from the main gopkg yaml.

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

Jump to

Keyboard shortcuts

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