project

package
v0.0.0-...-b7a57f2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const RestrictedProjectNameChars = `[a-zA-Z0-9/_.\-:]`

RestrictedProjectNameChars collects the characters allowed to represent a project.

Variables

View Source
var (
	ErrProjectIsLocal  = fmt.Errorf("can't use Remote() with local project")
	ErrProjectIsRemote = fmt.Errorf("can't use Local() with remote project")

	ErrInvalidProjectName = fmt.Errorf("invalid project name")

	ProjectNameFormatHint = "project name should be in the form 'project' or 'bob.build/user/project'"
)
View Source
var ProjectNameDoubleSlashPattern = regexp.MustCompile(`//+`)

ProjectNameDoubleSlashPattern matches a string containing a double slash (useful to check for URL schema)

View Source
var RestrictedProjectNamePattern = regexp.MustCompile(`^` + RestrictedProjectNameChars + `+$`)

RestrictedProjectNamePattern is a regular expression to validate projectnames.

Functions

This section is empty.

Types

type Name

type Name string

func Parse

func Parse(projectname string) (Name, error)

Parse a projectname and validate it against `RestrictedProjectNamePattern`

func (*Name) Local

func (n *Name) Local() (string, error)

func (*Name) Remote

func (n *Name) Remote() (*url.URL, error)

func (*Name) Type

func (n *Name) Type() T

type T

type T string
const (
	Local  T = "local"
	Remote T = "remote"
)

Jump to

Keyboard shortcuts

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