repos

package
v2.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package repos defines a generic repository.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorUnsupportedHost indicates the repo's host is unsupported.
	ErrorUnsupportedHost = errors.New("unsupported host")
	// ErrorInvalidGithubURL indicates the repo's GitHub URL is not in the proper format.
	ErrorInvalidGithubURL = errors.New("invalid GitHub repo URL")
	// ErrorInvalidURL indicates the repo's full GitHub URL was not passed.
	ErrorInvalidURL = errors.New("invalid repo flag")
)

Functions

This section is empty.

Types

type RepoURL

type RepoURL struct {
	Host, Owner, Repo string
	Metadata          []string
}

nolint:revive TODO: Remove RepoURL and replace all instances with clients.Repo interface.

func (*RepoURL) Set

func (r *RepoURL) Set(s string) error

Set parses a URL string into RepoURL struct.

func (*RepoURL) String

func (r *RepoURL) String() string

String returns a string representation of RepoURL struct.

func (*RepoURL) Type

func (r *RepoURL) Type() string

Type method is needed so that this struct can be used as cmd flag.

func (*RepoURL) URL

func (r *RepoURL) URL() string

URL returns a valid url for RepoURL struct.

func (*RepoURL) ValidGitHubURL

func (r *RepoURL) ValidGitHubURL() error

ValidGitHubURL checks whether RepoURL represents a valid GitHub repo and returns errors otherwise.

Jump to

Keyboard shortcuts

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