Documentation ¶
Overview ¶
Package model provides the model of repository and commit. As long as another model that will be use in gitgo command.
Index ¶
- type Commit
- type CommitHeader
- type CommitMessage
- type GitCommand
- type Repo
- func (r *Repo) Add(filepath []string) *manager.Throwable
- func (r *Repo) AddAll() *manager.Throwable
- func (r *Repo) GetCommit() *Commit
- func (r *Repo) GetGitRepository() *manager.ResultWrapper
- func (r *Repo) GetWorktree() *manager.ResultWrapper
- func (r *Repo) Setup()
- func (r *Repo) Status() *manager.ResultWrapper
- type YAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
// contains filtered or unexported fields
}
Commit is Commit object of deal with commit things.
func (*Commit) CustomCommit ¶
func (c *Commit) CustomCommit(answers CommitMessage)
CustomCommit will run git commit -m "<message>" with the default format.
func (*Commit) ListHeaderOptions ¶
func (c *Commit) ListHeaderOptions() *manager.ResultWrapper
ListHeaderOptions return the list of string of commit that create by Format() method in CommitHeader.
type CommitHeader ¶
CommitHeader is struct of Key and Value, using in list.yaml.
func (*CommitHeader) Format ¶
func (c *CommitHeader) Format() string
Format will return format of string.
func (*CommitHeader) String ¶
func (c *CommitHeader) String() string
String will return string that show what is it.
type CommitMessage ¶
CommitMessage is the commit message for save in commit.
func (*CommitMessage) GetKey ¶
func (c *CommitMessage) GetKey() string
GetKey will try to format the key to right way. Otherwise, return normal Key
type GitCommand ¶
type GitCommand struct {
// contains filtered or unexported fields
}
GitCommand is git-cli command with custom stdout and custom stderr
func (*GitCommand) Exec ¶
func (g *GitCommand) Exec(args ...string) *manager.ErrManager
Exec will run git cli in command line
func (*GitCommand) SetErrWriter ¶
func (g *GitCommand) SetErrWriter(err io.Writer) *GitCommand
SetErrWriter will set err writer
func (*GitCommand) SetOutWriter ¶
func (g *GitCommand) SetOutWriter(out io.Writer) *GitCommand
SetOutWriter will set out writer
func (*GitCommand) SetReader ¶
func (g *GitCommand) SetReader(in io.Reader) *GitCommand
SetReader will set reader
type Repo ¶
type Repo struct { Manager *manager.ResultManager // contains filtered or unexported fields }
Repo is git repository object for gitgo.
func NewRepo ¶
func NewRepo() *Repo
NewRepo will return new repository with current path. you must call setup for load git repository to memory.
func (*Repo) Add ¶
Add get array of filepath, and return ErrManager. anyway, It's will run os.Exit with code 10 if any error occurred.
func (*Repo) AddAll ¶
func (r *Repo) AddAll() *manager.Throwable
AddAll will run git add -A command in cli.
func (*Repo) GetGitRepository ¶
func (r *Repo) GetGitRepository() *manager.ResultWrapper
GetGitRepository will return git.Repository of this Repo
func (*Repo) GetWorktree ¶
func (r *Repo) GetWorktree() *manager.ResultWrapper
GetWorktree is getter method, which get git.Worktree from git.Repository. It's will Exit with code 5 if any error occurred.
type YAML ¶
type YAML struct{}
YAML is object of config yaml
func (*YAML) GDefaultConfig ¶
GDefaultConfig is global default config.yaml
func (*YAML) GDefaultList ¶
GDefaultList is global default list.yaml