Documentation
¶
Overview ¶
Package git provides infrastructure adapters for git operations.
Index ¶
- Constants
- type Adapter
- func (a *Adapter) CreateTag(ctx context.Context, name string, hash sourcecontrol.CommitHash, ...) (*sourcecontrol.Tag, error)
- func (a *Adapter) DeleteTag(ctx context.Context, name string) error
- func (a *Adapter) Fetch(ctx context.Context, remote string) error
- func (a *Adapter) GetBranches(ctx context.Context) ([]sourcecontrol.BranchInfo, error)
- func (a *Adapter) GetCommit(ctx context.Context, hash sourcecontrol.CommitHash) (*sourcecontrol.Commit, error)
- func (a *Adapter) GetCommitsBetween(ctx context.Context, from, to string) ([]*sourcecontrol.Commit, error)
- func (a *Adapter) GetCommitsSince(ctx context.Context, ref string) ([]*sourcecontrol.Commit, error)
- func (a *Adapter) GetCurrentBranch(ctx context.Context) (string, error)
- func (a *Adapter) GetInfo(ctx context.Context) (*sourcecontrol.RepositoryInfo, error)
- func (a *Adapter) GetLatestCommit(ctx context.Context, branch string) (*sourcecontrol.Commit, error)
- func (a *Adapter) GetLatestVersionTag(ctx context.Context, prefix string) (*sourcecontrol.Tag, error)
- func (a *Adapter) GetRemotes(ctx context.Context) ([]sourcecontrol.RemoteInfo, error)
- func (a *Adapter) GetStatus(ctx context.Context) (*sourcecontrol.WorkingTreeStatus, error)
- func (a *Adapter) GetTag(ctx context.Context, name string) (*sourcecontrol.Tag, error)
- func (a *Adapter) GetTags(ctx context.Context) (sourcecontrol.TagList, error)
- func (a *Adapter) IsDirty(ctx context.Context) (bool, error)
- func (a *Adapter) Pull(ctx context.Context, remote, branch string) error
- func (a *Adapter) Push(ctx context.Context, remote, branch string) error
- func (a *Adapter) PushTag(ctx context.Context, name string, remote string) error
Constants ¶
const ( // DefaultLocalTimeout is the timeout for local git operations (read-only). DefaultLocalTimeout = 30 * time.Second // DefaultRemoteTimeout is the timeout for remote git operations (network calls). DefaultRemoteTimeout = 60 * time.Second )
Default timeouts for git operations to prevent hangs on slow/unreachable remotes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter adapts the existing git service to the domain interface.
func NewAdapter ¶
func NewAdapter(svc gitservice.Service) *Adapter
NewAdapter creates a new git adapter.
func (*Adapter) CreateTag ¶
func (a *Adapter) CreateTag(ctx context.Context, name string, hash sourcecontrol.CommitHash, message string) (*sourcecontrol.Tag, error)
CreateTag creates a new tag.
func (*Adapter) GetBranches ¶
func (a *Adapter) GetBranches(ctx context.Context) ([]sourcecontrol.BranchInfo, error)
GetBranches retrieves branch information.
func (*Adapter) GetCommit ¶
func (a *Adapter) GetCommit(ctx context.Context, hash sourcecontrol.CommitHash) (*sourcecontrol.Commit, error)
GetCommit retrieves a specific commit.
func (*Adapter) GetCommitsBetween ¶
func (a *Adapter) GetCommitsBetween(ctx context.Context, from, to string) ([]*sourcecontrol.Commit, error)
GetCommitsBetween retrieves commits between two references.
func (*Adapter) GetCommitsSince ¶
GetCommitsSince retrieves commits since a reference.
func (*Adapter) GetCurrentBranch ¶
GetCurrentBranch retrieves the current branch name.
func (*Adapter) GetInfo ¶
func (a *Adapter) GetInfo(ctx context.Context) (*sourcecontrol.RepositoryInfo, error)
GetInfo retrieves repository information.
func (*Adapter) GetLatestCommit ¶
func (a *Adapter) GetLatestCommit(ctx context.Context, branch string) (*sourcecontrol.Commit, error)
GetLatestCommit retrieves the latest commit on a branch.
func (*Adapter) GetLatestVersionTag ¶
func (a *Adapter) GetLatestVersionTag(ctx context.Context, prefix string) (*sourcecontrol.Tag, error)
GetLatestVersionTag retrieves the latest version tag.
func (*Adapter) GetRemotes ¶
func (a *Adapter) GetRemotes(ctx context.Context) ([]sourcecontrol.RemoteInfo, error)
GetRemotes retrieves remote information.
func (*Adapter) GetStatus ¶
func (a *Adapter) GetStatus(ctx context.Context) (*sourcecontrol.WorkingTreeStatus, error)
GetStatus retrieves the working tree status.