autocommit

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitChangesOption   = "Commit changes to git"
	RegenerateOption      = "Regenerate commit message"
	CopyToClipboardOption = "Copy message to clipboard"
	ExitOption            = "Exit"
)
View Source
const SystemMsg = `` /* 3197-byte string literal not displayed */

SystemMsg is the message that will feed the OpenAI API to generate the commit message.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clipboard

type Clipboard interface {
	// Copy copies the given message to the clipboard.
	Copy(message string) error
}

Clipboard is an interface that defines the Copy method.

func MakeClipboard

func MakeClipboard() Clipboard

func NewClipboard

func NewClipboard() Clipboard

NewClipboard creates a new instance of Clipboard.

type ClipboardCommand

type ClipboardCommand interface {
	Execute(message string) error
}

func MakeClipboardCommand

func MakeClipboardCommand() ClipboardCommand

func NewClipboardCommand

func NewClipboardCommand(clipboard Clipboard) ClipboardCommand

type GeneratorCommand

type GeneratorCommand interface {
	// Execute returns the commit message generated by OpenAI.
	Execute() (string, error)
}

GeneratorCommand is the interface that wraps the Execute method.

func MakeGeneratorCommand

func MakeGeneratorCommand() GeneratorCommand

func NewGeneratorCommand

func NewGeneratorCommand(chatCommand openai.ChatCommand, diffCommand git.DiffCommand) GeneratorCommand

NewGeneratorCommand creates a new instance of GeneratorCommand.

type PostCommitCli

type PostCommitCli interface {
	// Execute executes the post commit CLI.
	Execute() (string, error)
}

PostCommitCli is an interface for executing post commit CLI operations.

func MakePostCommitCli

func MakePostCommitCli() PostCommitCli

func NewPostCommitCli

func NewPostCommitCli() PostCommitCli

NewPostCommitCli creates a new instance of PostCommitCli.

Jump to

Keyboard shortcuts

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