Documentation
¶
Index ¶
- Variables
- func GetCommitHashes(context context.Context, cmd *cobra.Command, args []string, toComplete string) (hashes []string, err error)
- type Commit
- func GetCommitByHash(ctx context.Context, cmd *cobra.Command, hash string) (commit *Commit, err error)
- func GetCommits(context context.Context, cmd *cobra.Command) (commits []Commit, err error)
- func GetCommitsWithPrefix(context context.Context, cmd *cobra.Command, prefix string) (commits []Commit, err error)
- func GetLatestCommit(ctx context.Context, cmd *cobra.Command) (commit *Commit, err error)
- func (commit Commit) GetColumnDefinitions() common.Columns[Commit]
- func (commit Commit) GetHeaders(cmd *cobra.Command) []string
- func (commit Commit) GetReference() *CommitReference
- func (commit Commit) GetRow(headers []string) []string
- func (commit Commit) GetShortHash() string
- func (commit Commit) GetType() string
- func (commit Commit) MarshalJSON() (data []byte, err error)
- func (commit Commit) String() string
- func (commit *Commit) Validate() error
- type CommitReference
- type Commits
- type RenderedMessage
Constants ¶
This section is empty.
Variables ¶
var Command = &cobra.Command{ Use: "commit", Short: "Manage commits", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Commit requires a subcommand:") for _, command := range cmd.Commands() { fmt.Println(command.Name()) } }, }
Command represents this folder's command
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
Hash string `json:"hash" mapstructure:"hash"`
Author user.Author `json:"author" mapstructure:"author"`
Message string `json:"message" mapstructure:"message"`
Summary *common.RenderedText `json:"summary,omitempty" mapstructure:"summary"`
Rendered *RenderedMessage `json:"rendered,omitempty" mapstructure:"rendered"`
Parents []CommitReference `json:"parents,omitempty" mapstructure:"parents"`
Date time.Time `json:"date" mapstructure:"date"`
Repository repository.Repository `json:"repository" mapstructure:"repository"`
Links common.Links `json:"links" mapstructure:"links"`
}
func GetCommitByHash ¶
func GetCommitByHash(ctx context.Context, cmd *cobra.Command, hash string) (commit *Commit, err error)
GetCommitByHash gets a commit by its hash
func GetCommits ¶
GetCommits gets the commits of a repository
func GetCommitsWithPrefix ¶
func GetCommitsWithPrefix(context context.Context, cmd *cobra.Command, prefix string) (commits []Commit, err error)
GetCommitsWithPrefix gets the commits of a repository with a prefix
func GetLatestCommit ¶
GetLatestCommit gets the latest commit of the repository
func (Commit) GetColumnDefinitions ¶
GetColumnDefinitions gets the column definitions for commits
func (Commit) GetReference ¶
func (commit Commit) GetReference() *CommitReference
GetReference gets the reference string for this commit
func (Commit) GetShortHash ¶
GetShortHash gets the short hash of this commit
func (Commit) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
type CommitReference ¶
type CommitReference struct {
Hash string `json:"hash" mapstructure:"hash"`
Links common.Links `json:"links" mapstructure:"links"`
}
func (CommitReference) AsCommit ¶
func (reference CommitReference) AsCommit() *Commit
AsCommit converts this CommitRef to a Commit
func (CommitReference) GetShortHash ¶
func (reference CommitReference) GetShortHash() string
GetShortHash gets the short hash of this commit
func (CommitReference) MarshalJSON ¶
func (reference CommitReference) MarshalJSON() (data []byte, err error)
MarshalJSON implements the json.Marshaler interface.
func (CommitReference) String ¶
func (reference CommitReference) String() string
String gets a string representation of this commit
implements fmt.Stringer
type Commits ¶
type Commits []Commit
type RenderedMessage ¶
type RenderedMessage struct {
Message common.RenderedText `json:"message" mapstructure:"message"`
}