Documentation
¶
Index ¶
- func InitMetrics(registerer prometheus.Registerer)
- type Client
- func (c *Client) Add(path string) error
- func (c *Client) AddRemote(name, url string) error
- func (c *Client) ApplyPatch(patch string) error
- func (c *Client) ApprovePullRequest(id int) error
- func (c *Client) CherryPick(commitHash string) error
- func (c *Client) Clean(force bool) error
- func (c *Client) CommitAndPush(files map[string]string, message string) (string, error)
- func (c *Client) CommitAndPushChanges(message string) error
- func (c *Client) CommitFiles(files []string, msg string) error
- func (c *Client) CreateBranch(name string) error
- func (c *Client) CreatePatch(options DiffOptions) (string, error)
- func (c *Client) CreatePullRequest(options PullRequestOptions) (PullRequestInfo, error)
- func (c *Client) CreateTag(name, message string) error
- func (c *Client) DeleteBranch(name string) error
- func (c *Client) Fetch(remote string) error
- func (c *Client) GetCommitHistory(options LogOptions) ([]CommitInfo, error)
- func (c *Client) GetCurrentBranch() (string, error)
- func (c *Client) GetDiff(options DiffOptions) (string, error)
- func (c *Client) GetFileContent(path string) ([]byte, error)
- func (c *Client) GetLog(options LogOptions) ([]CommitInfo, error)
- func (c *Client) GetPullRequestStatus(id int) (string, error)
- func (c *Client) GetRemotes() ([]RemoteInfo, error)
- func (c *Client) GetStatus() ([]StatusInfo, error)
- func (c *Client) GetTagInfo(name string) (TagInfo, error)
- func (c *Client) InitRepo() error
- func (c *Client) ListBranches() ([]string, error)
- func (c *Client) ListTags() ([]TagInfo, error)
- func (c *Client) MergeBranch(sourceBranch, targetBranch string) error
- func (c *Client) MergePullRequest(id int) error
- func (c *Client) Move(oldPath, newPath string) error
- func (c *Client) Pull(remote string) error
- func (c *Client) Push(remote string) error
- func (c *Client) RebaseBranch(sourceBranch, targetBranch string) error
- func (c *Client) Remove(path string) error
- func (c *Client) RemoveDirectory(path string, commitMessage string) error
- func (c *Client) RemoveRemote(name string) error
- func (c *Client) Reset(options ResetOptions) error
- func (c *Client) Restore(path string) error
- func (c *Client) SwitchBranch(name string) error
- type ClientConfig
- type ClientInterface
- type CommitInfo
- type DiffOptions
- type LogOptions
- type PullRequestInfo
- type PullRequestOptions
- type RemoteInfo
- type ResetOptions
- type StatusInfo
- type TagInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMetrics ¶
func InitMetrics(registerer prometheus.Registerer)
Types ¶
type Client ¶
type Client struct {
RepoURL string
Branch string
SSHKey string
RepoPath string
// contains filtered or unexported fields
}
func NewClientFromConfig ¶
func NewClientFromConfig(config *ClientConfig) *Client
func NewClientWithLogger ¶
func (*Client) ApplyPatch ¶
func (*Client) ApprovePullRequest ¶
func (*Client) CherryPick ¶
func (*Client) CommitAndPush ¶
func (*Client) CommitAndPushChanges ¶
func (*Client) CreateBranch ¶
func (*Client) CreatePatch ¶
func (c *Client) CreatePatch(options DiffOptions) (string, error)
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(options PullRequestOptions) (PullRequestInfo, error)
func (*Client) DeleteBranch ¶
func (*Client) GetCommitHistory ¶
func (c *Client) GetCommitHistory(options LogOptions) ([]CommitInfo, error)
func (*Client) GetCurrentBranch ¶
func (*Client) GetLog ¶
func (c *Client) GetLog(options LogOptions) ([]CommitInfo, error)
func (*Client) GetRemotes ¶
func (c *Client) GetRemotes() ([]RemoteInfo, error)
func (*Client) GetStatus ¶
func (c *Client) GetStatus() ([]StatusInfo, error)
func (*Client) ListBranches ¶
func (*Client) MergeBranch ¶
func (*Client) MergePullRequest ¶
func (*Client) RebaseBranch ¶
func (*Client) RemoveDirectory ¶
func (*Client) RemoveRemote ¶
func (*Client) Reset ¶
func (c *Client) Reset(options ResetOptions) error
func (*Client) SwitchBranch ¶
type ClientConfig ¶
type ClientConfig struct {
RepoURL string
Branch string
Token string // Token loaded from file or environment
TokenPath string // Optional path to token file
RepoPath string
Logger *slog.Logger
ConcurrentPushLimit int // Maximum concurrent git operations (default 4 if <= 0)
}
func NewGitClientConfig ¶
func NewGitClientConfig(repoURL, branch, token, tokenPath string) (*ClientConfig, error)
type ClientInterface ¶
type ClientInterface interface {
CommitAndPush(files map[string]string, message string) (string, error)
CommitAndPushChanges(message string) error
InitRepo() error
RemoveDirectory(path string, commitMessage string) error
CommitFiles(files []string, msg string) error
CreateBranch(name string) error
SwitchBranch(name string) error
GetCurrentBranch() (string, error)
ListBranches() ([]string, error)
GetFileContent(path string) ([]byte, error)
}
type CommitInfo ¶
type DiffOptions ¶
type LogOptions ¶
type PullRequestInfo ¶
type PullRequestOptions ¶
type RemoteInfo ¶
type ResetOptions ¶
type StatusInfo ¶
Click to show internal directories.
Click to hide internal directories.