packages

package
v0.2.8-dev Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoModDir

func GoModDir() (string, error)

func GoPath

func GoPath() string

func InstallPackage

func InstallPackage(info *PackageInfo) error

func MarkerPackagePath

func MarkerPackagePath(pkg, version string) string

func MarkerPackagePathFromPackageInfo

func MarkerPackagePathFromPackageInfo(info *PackageInfo) string

func MarkerPackageYamlPath

func MarkerPackageYamlPath(info *PackageInfo) string

func MarkerProcessorYamlPath

func MarkerProcessorYamlPath(info *PackageInfo) string

Types

type LoadResult

type LoadResult struct {
	// contains filtered or unexported fields
}

func LoadPackages

func LoadPackages(patterns ...string) (*LoadResult, error)

LoadPackages loads and returns the Go packages by the given patterns.

func LoadPackagesWithConfig

func LoadPackagesWithConfig(config *packages.Config, patterns ...string) (*LoadResult, error)

LoadPackagesWithConfig functions like LoadPackages. Except that it allows passing a custom config.

func (*LoadResult) GetPackages

func (result *LoadResult) GetPackages() []*Package

func (*LoadResult) Lookup

func (result *LoadResult) Lookup(pkgPath string) (*Package, error)

type MarkerPackage

type MarkerPackage struct {
	Path               string   `json:"Path"`
	Version            string   `json:"Version"`
	LatestVersion      string   `json:"LatestVersion"`
	DownloadedVersions []string `json:"DownloadedVersions"`
	AvailableVersions  []string `json:"AvailableVersions"`
	Dir                string   `json:"Dir"`
	GoVersion          string   `json:"GoVersion"`
}

func GetMarkerPackage

func GetMarkerPackage(path string) (*MarkerPackage, error)

type Package

type Package struct {
	*packages.Package
	// contains filtered or unexported fields
}

func (*Package) IsStandardPackage

func (pkg *Package) IsStandardPackage() bool

type PackageInfo

type PackageInfo struct {
	Path      string    `json:"Path"`
	Version   string    `json:"Version"`
	Versions  []string  `json:"Versions"`
	Time      time.Time `json:"Time"`
	Dir       string    `json:"Dir"`
	GoMod     string    `json:"GoMod"`
	GoVersion string    `json:"GoVersion"`
}

func GetPackageInfo

func GetPackageInfo(path string) (*PackageInfo, error)

func (*PackageInfo) ModulePath

func (p *PackageInfo) ModulePath() string

func (*PackageInfo) Name

func (p *PackageInfo) Name() string

Jump to

Keyboard shortcuts

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