golang

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoMod = "go.mod"

	GitHubPath  = "github.com/"
	GooglePath  = "go.googlesource.com/"
	GoPkgInPath = "gopkg.in/"
)

Variables

View Source
var StandardPackages = map[string]struct{}{}/* 261 elements not displayed */

Functions

func StandardLibraryURL

func StandardLibraryURL(path string) (string, bool)

StandardLibraryURL returns the URL of the standard library package from the given local path if it exists.

func StdPackages

func StdPackages(version string) (map[string]struct{}, error)

StdPackages returns a map of all standard packages for the given version.

func VendorRelativePath

func VendorRelativePath(path string) (string, bool)

VendorRelativePath returns the relative path of the given path if it is a vendor path. For example: /drone/src/vendor/google.golang.org/protobuf/proto/merge.go -> /vendor/google.golang.org/protobuf/proto/merge.go

Types

type GitHubFile

type GitHubFile struct {
	Owner, Repo, Ref, Path string
}

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Module

type Module struct {
	module.Version
	FilePath string
}

Module represents a go module with a file path in that module

func ParseModuleFromPath

func ParseModuleFromPath(path string) (Module, bool)

ParseModuleFromPath parses the module from the given path.

func (Module) GithubFile

func (m Module) GithubFile() (GitHubFile, error)

GithubFile returns the github file information.

func (Module) GoogleSourceURL

func (m Module) GoogleSourceURL() (string, error)

GoogleSourceURL returns the URL of the file in the google source repository. Example https://go.googlesource.com/oauth2/+/4ce7bbb2ffdc6daed06e2ec28916fd08d96bc3ea/amazon/amazon.go

func (Module) IsGitHub

func (m Module) IsGitHub() bool

func (Module) IsGoPkgIn

func (m Module) IsGoPkgIn() bool

func (Module) IsGoogleSource

func (m Module) IsGoogleSource() bool

func (*Module) Resolve

func (module *Module) Resolve(ctx context.Context, mainModule module.Version, modfile *modfile.File, httpClient HttpClient) error

Resolve resolves the module path to a canonical path.

func (Module) String

func (m Module) String() string

Jump to

Keyboard shortcuts

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