pkg

package
v0.0.0-...-668fbc5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FileNames = []string{
		"COPYING",
		"COPYING.md",
		"COPYING.markdown",
		"COPYING.txt",
		"LICENCE",
		"LICENCE.md",
		"LICENCE.markdown",
		"LICENCE.txt",
		"LICENSE",
		"LICENSE.md",
		"LICENSE.markdown",
		"LICENSE.txt",
		"LICENSE-2.0.txt",
		"LICENCE-2.0.txt",
		"LICENSE-APACHE",
		"LICENCE-APACHE",
		"LICENSE-APACHE-2.0.txt",
		"LICENCE-APACHE-2.0.txt",
		"LICENSE-MIT",
		"LICENCE-MIT",
		"LICENSE.MIT",
		"LICENCE.MIT",
		"LICENSE.code",
		"LICENCE.code",
		"LICENSE.docs",
		"LICENCE.docs",
		"LICENSE.rst",
		"LICENCE.rst",
		"MIT-LICENSE",
		"MIT-LICENCE",
		"MIT-LICENSE.md",
		"MIT-LICENCE.md",
		"MIT-LICENSE.markdown",
		"MIT-LICENCE.markdown",
		"MIT-LICENSE.txt",
		"MIT-LICENCE.txt",
		"MIT_LICENSE",
		"MIT_LICENCE",
		"UNLICENSE",
		"UNLICENCE",
	}
)

Functions

func FindLicenses

func FindLicenses(fsys fs.FS) []string

func GetModule

func GetModule(module, version, proxy string, force bool) (fs.FS, error)

GetModule get the module from the proxy, or local cache if it exists. If force is true, it will always get the module from the proxy. If it cannot find the go.sum locally, will get it from the proxy.

func GetVersions

func GetVersions(module, proxy string) ([]string, error)

func WriteToZip

func WriteToZip(fsys fs.FS, zw *zip.Writer) ([]string, error)

Types

type ModFile

type ModFile struct {
	Name      string
	GoVersion string
	Requires  []Package
	Replace   map[string]Package
}

func ParseMod

func ParseMod(r io.Reader) (*ModFile, error)

type Package

type Package struct {
	Name     string
	Version  string
	Indirect bool   // used only for go.mod
	Hash     string // used only for go.sum
}

func ParseSum

func ParseSum(r io.Reader) (pkgs []Package)

func (Package) String

func (p Package) String() string

Jump to

Keyboard shortcuts

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