Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch interface {
// Checkout a new branch with the specified name
Checkout(name string) error
// Current returns the name of the current branch
Current() (string, error)
// ValidateName checks if a given name is a potentially valid branch name
ValidateName(name string) error
}
Branch is the interface to abstract git branch handling
type CommandError ¶
type CommandError struct {
Err error
// The actually executed OS command
Cmd *exec.Cmd
// Human readable string of the command output
Output string
}
CommandError in case a git command execution fails
func NewCommandError ¶
func NewCommandError(err error, cmd *exec.Cmd, cmdOutput []byte) *CommandError
NewCommandError returns an new instance of CommandError with specified values
func (CommandError) Error ¶
func (err CommandError) Error() string
Error returns the actual error message
type Commit ¶
type Commit interface {
// New creates a new git commit with the specified message
New(message string) error
// LogsBetweenVersions returns a log between two commit versions
// If used with empty strings as versionA and B it returns the full current log
LogsBetweenVersions(versionA, versionB string) ([]CommitLog, error)
}
Commit is the interface to abstract git commit handling
type CommitLog ¶
type CommitLog struct {
// Author (name) of the commit
Author string
// AuthorEmail of the commit
AuthorEmail string
// Hash to identify the commit
Hash string
// Message of the commit
Message string
Timestamp string
}
CommitLog is the data structure for a log of a git commit
type InvalidBranchNameError ¶
InvalidBranchNameError is returned if a branch has a invalid name
func NewInvalidBranchNameError ¶
func NewInvalidBranchNameError(err error, name string) *InvalidBranchNameError
NewInvalidBranchNameError returns an new instance of InvalidBranchNameError
func (InvalidBranchNameError) Error ¶
func (err InvalidBranchNameError) Error() string
Error returns the actual error message
type Remote ¶
type Remote interface {
// GetHttpURL returns the URL of the given remote name in HTTP(S) format
GetHttpURL(name string) (string, error)
// GetProject returns the project part of the remote remote URL
GetProject(name string) (string, error)
// GetProjectByHttpURL extracts the project name of a given repo HTTP url
GetProjectByHttpURL(httpURL string) (string, error)
// GetURL returns the URL of the given remote name
GetURL(name string) (*url.URL, error)
}
Remote is the interface to manage git remotes
type Tag ¶
Click to show internal directories.
Click to hide internal directories.