getter

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectType

func DetectType(src string) (name string, source string, found bool, err error)

func Get

func Get(ctx context.Context, installPath, url string, options ...getter.ClientOption) error

func NormalizePath

func NormalizePath(src string) string

func ParseSourceSubPolicy

func ParseSourceSubPolicy(src string) (policySrc string, subdir string)

ParseSourceSubPolicy takes a source URL and returns a tuple of the URL without the subdir and the subdir.

ex:

dom.com/path/?q=p               => dom.com/path/?q=p, ""
proto://dom.com/path//*?q=p     => proto://dom.com/path?q=p, "*"
proto://dom.com/path//path2?q=p => proto://dom.com/path?q=p, "path2"
dom.com/path@q=p               => dom.com/path/?q=p, ""

Types

type Detector added in v0.23.1

type Detector struct {
	Name     string
	Detector getter.Detector
}

type GitHubDetector

type GitHubDetector struct{}

GitHubDetector implements Detector to detect GitHub URLs and turn them into URLs that the Git Getter can understand.

func (*GitHubDetector) Detect

func (d *GitHubDetector) Detect(src, _ string) (string, bool, error)

type HubDetector

type HubDetector struct {
}

func (HubDetector) Detect

func (h HubDetector) Detect(src, pwd string) (string, bool, error)

Jump to

Keyboard shortcuts

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