Documentation ¶
Index ¶
- Variables
- func CheckRepoHost(ctx GitHubContext, repo *Repo) error
- func FindProjectPath(ctx Context, repo *Repo) (string, error)
- func Query(ctx Context, query string, walk Walker, callback WalkFunc) error
- func SupportedHost(ctx GitHubContext, host string) error
- func ValidateContext(ctx Context) error
- func ValidateLogLevel(level string) error
- func ValidateName(name string) error
- func ValidateOwner(owner string) error
- func ValidateRoot(root string) (string, error)
- func ValidateRoots(roots []string) error
- func Walk(ctx Context, callback WalkFunc) error
- func WalkInPrimary(ctx Context, callback WalkFunc) error
- type Context
- type GitHubContext
- type IOContext
- type LogContext
- type Project
- func FindOrNewProject(ctx Context, repo *Repo) (*Project, error)
- func FindOrNewProjectInPrimary(ctx Context, repo *Repo) (*Project, error)
- func FindProject(ctx Context, repo *Repo) (*Project, error)
- func FindProjectInPrimary(ctx Context, repo *Repo) (*Project, error)
- func NewProject(ctx Context, repo *Repo) (*Project, error)
- type ProjectListFormatter
- type ProjectShared
- type Repo
- func (r *Repo) FullName(ctx GitHubContext) string
- func (r *Repo) Host(ctx GitHubContext) string
- func (r *Repo) IsPublic(ctx GitHubContext) (bool, error)
- func (r *Repo) Match(p *Project) bool
- func (r *Repo) Name(_ GitHubContext) string
- func (r *Repo) Owner(ctx GitHubContext) string
- func (r *Repo) RelPath(ctx GitHubContext) string
- func (r *Repo) Scheme(_ GitHubContext) string
- func (r *Repo) Set(rawRepo string) error
- func (r Repo) String() string
- func (r *Repo) URL(ctx GitHubContext, ssh bool) *url.URL
- type Repos
- 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") )
Functions ¶
func CheckRepoHost ¶ added in v0.4.0
func CheckRepoHost(ctx GitHubContext, repo *Repo) error
CheckRepoHost that repo is in supported host
func FindProjectPath ¶ added in v0.4.0
FindProjectPath willl get a project (local repository) path from remote repository URL
func SupportedHost ¶ added in v1.0.0
func SupportedHost(ctx GitHubContext, host string) error
SupportedHost that repo is in supported host
func ValidateContext ¶ added in v1.0.0
func ValidateLogLevel ¶ added in v1.0.0
func ValidateName ¶ added in v0.5.6
func ValidateOwner ¶ added in v0.5.6
func ValidateRoot ¶ added in v1.0.0
func ValidateRoots ¶ added in v1.0.0
func WalkInPrimary ¶ added in v0.2.0
WalkInPrimary thorugh projects (local repositories) in the first gogh.root directory
Types ¶
type Context ¶ added in v0.1.0
type Context interface { context.Context IOContext GitHubContext LogContext Root() []string PrimaryRoot() string }
Context holds configurations and environments
type GitHubContext ¶ added in v1.3.1
GitHubContext holds configurations and environments for GitHub access.
type LogContext ¶ added in v1.3.1
type LogContext interface { LogLevel() string LogFlags() int // log.Lxxx flags LogDate() bool LogTime() bool LogMicroSeconds() bool LogLongFile() bool LogShortFile() bool LogUTC() bool }
GitHubContext holds configurations and environments for logging.
type Project ¶ added in v0.4.0
Project repository specifier
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 NewProject ¶ added in v0.4.0
NewProject creates a project (local repository)
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 // contains filtered or unexported methods }
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 URLFormatter ¶ added in v0.5.7
func URLFormatter() ProjectListFormatter
URLFormatter prints each project as url.
type ProjectShared ¶ added in v0.4.0
type ProjectShared string
ProjectShared notices file shared flag like group, all, everybody, 0766.
func (*ProjectShared) Set ¶ added in v0.4.0
func (s *ProjectShared) Set(text string) error
Set text as ProjectShared
func (ProjectShared) String ¶ added in v0.4.0
func (s ProjectShared) String() string
type Repo ¶ added in v0.4.0
type Repo struct {
// contains filtered or unexported fields
}
Repo specifies a repository in the GitHub
func ParseProject ¶ added in v1.1.0
ParseProject parses a repo-name for a repository in the GitHub
func (*Repo) FullName ¶ added in v0.5.5
func (r *Repo) FullName(ctx GitHubContext) string
FullName returns a repository identifier that is formed like {Owner/Name}
func (*Repo) Host ¶ added in v0.4.0
func (r *Repo) Host(ctx GitHubContext) string
Host returns host of the repository
func (*Repo) IsPublic ¶ added in v1.1.0
func (r *Repo) IsPublic(ctx GitHubContext) (bool, error)
Check if a GitHub repo is public (we can access the repo without token or auth)
func (*Repo) Name ¶ added in v0.4.0
func (r *Repo) Name(_ GitHubContext) string
Name returns a name of the repository
func (*Repo) Owner ¶ added in v0.4.0
func (r *Repo) Owner(ctx GitHubContext) string
Owner returns a user name of an owner of the repository
func (*Repo) RelPath ¶ added in v0.4.0
func (r *Repo) RelPath(ctx GitHubContext) string
RelPath get relative path from root directory
func (*Repo) Scheme ¶ added in v0.4.0
func (r *Repo) Scheme(_ GitHubContext) string
Scheme returns scheme of the repository
type Repos ¶ added in v0.4.0
type Repos []Repo
Repos is array of Repo
func (Repos) IsCumulative ¶ added in v0.4.0
IsCumulative : 複数指定可能