Documentation
¶
Index ¶
- Variables
- func FindOrNewProject(ev Env, spec *RepoSpec) (*Project, *Repo, error)
- func FindOrNewProjectInPrimary(ev Env, spec *RepoSpec) (*Project, *Repo, error)
- func FindProject(ev Env, spec *RepoSpec) (*Project, *Repo, error)
- func FindProjectInPrimary(ev Env, spec *RepoSpec) (*Project, *Repo, error)
- func FindProjectPath(ev Env, spec *RepoSpec) (string, error)
- func PrimaryRoot(ev Env) string
- func Query(ev Env, query string, walk Walker, callback WalkFunc) error
- func ValidateHost(ev Env, host string) error
- func ValidateName(name string) error
- func ValidateOwner(owner string) error
- func Walk(ev Env, callback WalkFunc) error
- func WalkInPrimary(ev Env, callback WalkFunc) error
- type DefaultSpec
- type Env
- type ErrorInvalidName
- type ErrorInvalidOwner
- type ErrorUnsupportedHost
- type FormatWalkFunc
- type Project
- type ProjectListFormatter
- type Repo
- type RepoSpec
- type RepoSpecs
- type WalkFunc
- type Walker
Constants ¶
This section is empty.
Variables ¶
var ( // ErrProjectNotFound is the error will be raised when a project is not found. ErrProjectNotFound = errors.New("project not found") // ErrProjectAlreadyExists is the error will be raised when a project already exists. ErrProjectAlreadyExists = errors.New("project already exists") )
var ( ErrTooShallowPath = errors.New("too shallow path") ErrTooDeepPath = errors.New("too deep path") )
Functions ¶
func FindOrNewProject ¶ added in v0.5.8
FindOrNewProject will find a project (local repository) that matches exactly or create new one.
func FindOrNewProjectInPrimary ¶ added in v1.0.0
FindOrNewProjectInPrimary will find a project (local repository) that matches exactly or create new one.
func FindProject ¶ added in v0.4.0
FindProject will find a project (local repository) that matches exactly.
func FindProjectInPrimary ¶ added in v1.0.0
FindProjectInPrimary will find a project (local repository) that matches exactly.
func FindProjectPath ¶ added in v0.4.0
FindProjectPath willl get a project (local repository) path from remote repository URL
func PrimaryRoot ¶ added in v1.5.0
func ValidateHost ¶ added in v0.5.8
func ValidateName ¶ added in v0.5.6
func ValidateOwner ¶ added in v0.5.6
func WalkInPrimary ¶ added in v0.2.0
WalkInPrimary thorugh projects (local repositories) in the first gogh.root directory
Types ¶
type DefaultSpec ¶ added in v1.5.4
DefaultSpec descripts default properties
type ErrorInvalidName ¶ added in v1.5.5
type ErrorInvalidName string
func (ErrorInvalidName) Error ¶ added in v1.5.5
func (e ErrorInvalidName) Error() string
type ErrorInvalidOwner ¶ added in v1.5.5
type ErrorInvalidOwner string
func (ErrorInvalidOwner) Error ¶ added in v1.5.5
func (e ErrorInvalidOwner) Error() string
type ErrorUnsupportedHost ¶ added in v1.5.5
type ErrorUnsupportedHost struct {
// contains filtered or unexported fields
}
func (*ErrorUnsupportedHost) Error ¶ added in v1.5.5
func (e *ErrorUnsupportedHost) Error() string
type FormatWalkFunc ¶ added in v1.7.0
FormatWalkFunc is the function to accept projects and formatted string in the ProjectListFormatter.Walk
type Project ¶ added in v0.4.0
Project repository specifier
func NewProject ¶ added in v0.4.0
NewProject creates a project (local repository)
func ParseProject ¶ added in v1.1.0
func (*Project) IsInPrimaryRoot ¶ added in v0.4.0
IsInPrimaryRoot check which the repository is in primary root directory for gogh
type ProjectListFormatter ¶ added in v0.4.0
type ProjectListFormatter interface { Add(*Project) Len() int PrintAll(io.Writer, string) error Walk(FormatWalkFunc) error }
ProjectListFormatter holds project list to print them.
func CustomFormatter ¶ added in v1.3.0
func CustomFormatter(format string) (ProjectListFormatter, error)
func FullPathFormatter ¶ added in v0.2.0
func FullPathFormatter() ProjectListFormatter
FullPathFormatter prints each full-path of the project.
func RelPathFormatter ¶ added in v0.2.0
func RelPathFormatter() ProjectListFormatter
RelPathFormatter prints each relative-path of the project
func ShortFormatter ¶ added in v0.2.0
func ShortFormatter() ProjectListFormatter
ShortFormatter prints each project as short as possible.
func SpecFormatter ¶ added in v1.8.0
func SpecFormatter() ProjectListFormatter
SpecFormatter prints each relative-path of the project
func URLFormatter ¶ added in v0.5.7
func URLFormatter() ProjectListFormatter
URLFormatter prints each project as url.
type Repo ¶ added in v0.4.0
type Repo struct {
// contains filtered or unexported fields
}
Repo specifies a repository in the GitHub
func ParseRepo ¶ added in v0.4.0
func ParseRepo(df DefaultSpec, rawRepo string) (*Repo, error)
ParseRepo parses a repo-name for a repository in the GitHub
func (*Repo) FullName ¶ added in v0.5.5
FullName returns a repository identifier that is formed like {Owner/Name}
type RepoSpec ¶ added in v0.1.0
type RepoSpec struct {
// contains filtered or unexported fields
}
RepoSpec specifies a repository in the GitHub
func ParseRepoSpec ¶ added in v1.8.0
Parse text as RepoSpec
type RepoSpecs ¶ added in v0.2.0
type RepoSpecs []RepoSpec
RepoSpecs is array of RepoSpec