repourl

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidURL      = errors.New("invalid repository url")
	ErrUnsupportedHost = errors.New("unsupported host")
)

Functions

This section is empty.

Types

type URL

type URL struct {
	Host  string
	Owner string
	Repo  string
	// Ref represents ref of Git. There are 3 patterns: commit hash, "heads/BRANCH", and "tags/TAG".
	Ref string
}

URL is a URL of specific Git repository on well-known hosting services.

func Must

func Must(u *url.URL) *URL

func MustParse

func MustParse(s string) *URL

func New

func New(u *url.URL) (*URL, error)

func Parse

func Parse(s string) (*URL, error)

func (*URL) ArchiveURL

func (u *URL) ArchiveURL() *url.URL

func (*URL) Commit

func (u *URL) Commit() string

func (*URL) Head

func (u *URL) Head() string

func (*URL) String

func (u *URL) String() string

func (*URL) Tag

func (u *URL) Tag() string

Jump to

Keyboard shortcuts

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