command

package
v0.0.0-...-e6605fe Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Paths Paths
}

Command holds actions for commands

func New

func New(paths Paths) *Command

New returns a new Command

func (*Command) ManifestAdd

func (c *Command) ManifestAdd(id, name, email string) error

ManifestAdd adds a coauthor using manually entered information

func (*Command) ManifestFetchAdd

func (c *Command) ManifestFetchAdd(fetcher UserFetcher, usernames ...string) error

ManifestFetchAdd adds a coauthor by looking up their information remotely

func (*Command) ManifestList

func (c *Command) ManifestList(w io.Writer) error

ManifestList lists all coauthors

func (*Command) ManifestRemove

func (c *Command) ManifestRemove(ids ...string) error

ManifestRemove removes a coauthor from the Manifest

func (*Command) TemplateClear

func (c *Command) TemplateClear() error

TemplateClear emptys the coauthors Template

func (*Command) TemplateSet

func (c *Command) TemplateSet(ids ...string) error

TemplateSet activates a coauthor in the Template

func (*Command) TemplateStatus

func (c *Command) TemplateStatus(w io.Writer) error

TemplateStatus lists active coauthors

type GitHubFetcher

type GitHubFetcher struct {
	Client  *http.Client
	BaseURL string
}

func (*GitHubFetcher) Fetch

func (f *GitHubFetcher) Fetch(username string) (manifest.Coauthor, error)

type GitLabFetcher

type GitLabFetcher struct {
	Client  *http.Client
	BaseURL string
}

func (*GitLabFetcher) Fetch

func (f *GitLabFetcher) Fetch(username string) (manifest.Coauthor, error)

type Paths

type Paths struct {
	WorkDir      string
	ManifestFile string
}

Paths contains paths necessary for partner to do its work

func DefaultPaths

func DefaultPaths(workDir string) (Paths, error)

DefaultPaths returns calculated Git repository root, commit template and manifest paths relative to the current working directory.

func (Paths) Repository

func (p Paths) Repository() (RepositoryPaths, error)

Repository returns paths relative to the root of the Git project. If no Git repository (.git directory) is found, an error will be returned.

type RepositoryPaths

type RepositoryPaths struct {
	Root         string
	TemplateFile string
}

Repository specific paths

type UserFetcher

type UserFetcher interface {
	Fetch(username string) (manifest.Coauthor, error)
}

UserFetcher fetches coauthor information from somewhere else

Jump to

Keyboard shortcuts

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