Documentation
¶
Overview ¶
Package view is the view layer of the gogh command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProjectFormatFullFilePath = ProjectFormatFunc(func(p gogh.Project) (string, error) { return p.FullFilePath(), nil })
View Source
var ProjectFormatJSON = ProjectFormatFunc(func(p gogh.Project) (string, error) { utxt, err := ProjectFormatURL(p) if err != nil { return "", err } buf, _ := json.Marshal(map[string]interface{}{ "fullFilePath": p.FullFilePath(), "relFilePath": p.RelFilePath(), "url": utxt, "relPath": p.RelPath(), "host": p.Host(), "owner": p.Owner(), "name": p.Name(), }) return string(buf), nil })
View Source
var ProjectFormatRelFilePath = ProjectFormatFunc(func(p gogh.Project) (string, error) { return p.RelFilePath(), nil })
View Source
var ProjectFormatRelPath = ProjectFormatFunc(func(p gogh.Project) (string, error) { return p.RelPath(), nil })
View Source
var ProjectFormatURL = ProjectFormatFunc(func(p gogh.Project) (string, error) { utxt, err := gogh.GetDefaultRemoteURLFromLocalProject(context.Background(), p) if err != nil { if errors.Is(err, git.ErrRemoteNotFound) { utxt = "https://" + p.RelPath() } else { return "", err } } return utxt, nil })
Functions ¶
Types ¶
type ProjectFormat ¶
func ProjectFormatFields ¶
func ProjectFormatFields(s string) ProjectFormat
type ProjectFormatFunc ¶
func (ProjectFormatFunc) Format ¶
func (f ProjectFormatFunc) Format(p gogh.Project) (string, error)
type RepositoryFuncPrinter ¶
type RepositoryFuncPrinter func(gogh.Repository) error
func (RepositoryFuncPrinter) Close ¶
func (f RepositoryFuncPrinter) Close() error
func (RepositoryFuncPrinter) Print ¶
func (f RepositoryFuncPrinter) Print(r gogh.Repository) error
type RepositoryPrinter ¶
func NewRepositoryJSONPrinter ¶
func NewRepositoryJSONPrinter(w io.Writer) RepositoryPrinter
func NewRepositorySpecPrinter ¶
func NewRepositorySpecPrinter(w io.Writer) RepositoryPrinter
func NewRepositoryURLPrinter ¶
func NewRepositoryURLPrinter(w io.Writer) RepositoryPrinter
Click to show internal directories.
Click to hide internal directories.