Documentation
¶
Overview ¶
Package git provides API endpoints for git status and push operations.
Index ¶
- func Diff(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func DiscardAll(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func History(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func Pull(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func Push(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func RebuildIndex(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func ResetTo(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type CommitInfo
- type DiffResponse
- type FileDiff
- type HistoryResponse
- type PullPushResponse
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
func Diff(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Diff returns the diff for a specific commit
func DiscardAll ¶
func DiscardAll(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
DiscardAll resets the repository to origin/master (discards all local changes)
func History ¶
func History(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
History returns paginated commit history
func Pull ¶
func Pull(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Pull fetches and merges changes from the remote origin
func Push ¶
func Push(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Push pushes commits to the remote origin
func RebuildIndex ¶
func RebuildIndex(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
RebuildIndex manually triggers a full index rebuild
func ResetTo ¶
func ResetTo(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
ResetTo resets the repository to a specific commit (hard reset)
func Status ¶
func Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Status returns unpushed commits (commits ahead of origin/master)
Types ¶
type CommitInfo ¶
type CommitInfo struct {
Hash string `json:"hash"`
Message string `json:"message"`
Author string `json:"author"`
Date string `json:"date"`
}
CommitInfo contains details about a single Git commit.
type DiffResponse ¶
type DiffResponse struct {
Hash string `json:"hash"`
Message string `json:"message"`
Author string `json:"author"`
Date string `json:"date"`
Files []FileDiff `json:"files"`
}
DiffResponse contains the diff for a specific commit.
type FileDiff ¶
type FileDiff struct {
Name string `json:"name"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Patch string `json:"patch"`
}
FileDiff contains diff information for a single file.
type HistoryResponse ¶
type HistoryResponse struct {
Commits []CommitInfo `json:"commits"`
HasMore bool `json:"hasMore"`
Page int `json:"page"`
}
HistoryResponse contains paginated commit history.
type PullPushResponse ¶
PullPushResponse contains the result of a pull or push operation.
type StatusResponse ¶
type StatusResponse struct {
Ahead int `json:"ahead"`
Commits []CommitInfo `json:"commits"`
Remote string `json:"remote"`
}
StatusResponse contains unpushed commit information.