repos

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 8 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 RepoType added in v3.1.0

type RepoType int

RepoType is the type of a file.

const (
	// RepoTypeURL is for URLs.
	RepoTypeURL RepoType = iota
	// RepoTypeLocalDir is for source code in directories.
	RepoTypeLocalDir
)

type RepoURI added in v3.1.0

type RepoURI struct {
	// contains filtered or unexported fields
}

RepoURI represents the URI for a repo.

func NewFromLocalDirectory added in v3.1.0

func NewFromLocalDirectory(path string) *RepoURI

NewFromLocalDirectory creates a RepoURI as a local directory.

func NewFromURL added in v3.1.0

func NewFromURL(u string) (*RepoURI, error)

NewFromURL creates a RepoURI from URL.

func (*RepoURI) AppendMetadata added in v3.1.0

func (r *RepoURI) AppendMetadata(m ...string) error

AppendMetadata appends metadata.

func (*RepoURI) Equal added in v3.1.0

func (r *RepoURI) Equal(o *RepoURI) bool

Equal checks objects for equality.

func (*RepoURI) IsValidGitHubURL added in v3.1.0

func (r *RepoURI) IsValidGitHubURL() error

IsValidGitHubURL checks whether Repo represents a valid GitHub repo and returns errors otherwise.

func (*RepoURI) Metadata added in v3.1.0

func (r *RepoURI) Metadata() []string

Metadata returns a valid url for Repo struct.

func (*RepoURI) Path added in v3.1.0

func (r *RepoURI) Path() string

Path retusn the path for a local directory.

func (*RepoURI) RepoType added in v3.1.0

func (r *RepoURI) RepoType() RepoType

RepoType gives the type of URI.

func (*RepoURI) Set added in v3.1.0

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

Set parses a URI string into Repo struct.

func (*RepoURI) SetMetadata added in v3.1.0

func (r *RepoURI) SetMetadata(m []string) error

SetMetadata sets metadata.

func (*RepoURI) SetURL added in v3.1.0

func (r *RepoURI) SetURL(u string) error

SetURL sets the URL.

func (*RepoURI) String added in v3.1.0

func (r *RepoURI) String() string

String returns a string representation of Repo struct.

func (*RepoURI) Type added in v3.1.0

func (r *RepoURI) Type() string

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

func (*RepoURI) URL added in v3.1.0

func (r *RepoURI) URL() string

URL returns a valid url for Repo struct.

Jump to

Keyboard shortcuts

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