internal

package
v0.0.0-...-5e70b6e Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedPkgPath is returned when a package path is not supported by pkgtwist.
	ErrUnsupportedPkgPath = errors.New("package path is not supported")

	// PackageHostGithub represents GitHub as a package host.
	PackageHostGithub PackageHost = "github.com"
	// PackageHostGitlab represents GitLab as a package host.
	PackageHostGitlab PackageHost = "gitlab.com"

	// GithubPkgPathRegexp matches path for a Go package hosted on GitHub.
	GithubPkgPathRegexp = regexp.MustCompile(`^github\.com\/[A-Za-z0-9-]{1,39}\/[A-Za-z0-9\._-]{1,100}\/?`)
	// GitlabPkgPathRegexp matches path for a Go package hosted on GitLab.
	GitlabPkgPathRegexp = regexp.MustCompile(`^gitlab\.com\/(?:[a-zA-Z0-9\._-]{2,255})\/[a-zA-Z0-9\._-]{2,255}\/?`)
)

Functions

This section is empty.

Types

type Package

type Package struct {
	Path  string
	Owner string
	Name  string
	Host  PackageHost
}

Package represents a Go package or module.

func NewPackage

func NewPackage(path string) (Package, error)

NewPackage constructs a new Pkg

func (*Package) Repo

func (p *Package) Repo() string

type PackageHost

type PackageHost string

PackageHost represents a Go package host.

type Permutation

type Permutation struct {
	Result, Strategy string
}

Permutation represents a string permutated with a specific permutation strategy.

func Permute

func Permute(s string) ([]Permutation, error)

Permute permutates a string with a collection of permutation strategies and returns the results.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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