Documentation ¶
Index ¶
- Variables
- type Action
- type Actions
- type HistoryArgs
- type HistoryEntries
- type HistoryEntry
- type HistoryFile
- type HistoryFiles
- type HistoryResult
- type Result
- func (r *Result) Actions() Actions
- func (r *Result) CleanData() util.ValueMap
- func (r *Result) DataInt(k string) int
- func (r *Result) DataString(k string) string
- func (r *Result) DataStringArray(k string) []string
- func (r *Result) History() *HistoryResult
- func (r *Result) Strings() []string
- func (r *Result) ToCSV() ([]string, [][]string)
- type Results
- type Service
- func (s *Service) Commit(ctx context.Context, msg string, logger util.Logger) (*Result, error)
- func (s *Service) CreateRepo(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) Fetch(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) History(ctx context.Context, args *HistoryArgs, logger util.Logger) (*Result, error)
- func (s *Service) Magic(ctx context.Context, message string, dryRun bool, logger util.Logger) (*Result, error)
- func (s *Service) Outdated(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) Pull(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) Push(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) Reset(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) Status(ctx context.Context, logger util.Logger) (*Result, error)
- func (s *Service) UndoCommit(ctx context.Context, logger util.Logger) (*Result, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ActionStatus = &Action{Key: "status", Title: "Status", Description: "Returns the status of the repository"} ActionCreateRepo = &Action{Key: "createrepo", Title: "Create Repo", Description: "Creates a git repo and makes an initial commit"} ActionMagic = &Action{Key: "magic", Title: "Magic", Description: "Does everything it can to bring the repo up to date (stash, pull, pop, commit, push)"} ActionFetch = &Action{Key: "fetch", Title: "Fetch", Description: "Fetches the latest changes from the repository"} ActionCommit = &Action{Key: "commit", Title: "Commit", Description: "Adds all files, commits with the provided message"} ActionPull = &Action{Key: "pull", Title: "Pull", Description: "Pulls pending commits from upstream"} ActionPush = &Action{Key: "push", Title: "Push", Description: "Pushes pending commits to the remote"} ActionReset = &Action{Key: "reset", Title: "Reset", Description: "Resets all local changes; be careful"} ActionBranch = &Action{Key: "branch", Title: "Branch", Description: "Switch to a new branch"} ActionUndoCommit = &Action{Key: "undocommit", Title: "Undo", Description: "Removes the most recent commit, keeping all local changes"} ActionOutdated = &Action{Key: "outdated", Title: "Outdated", Description: "Finds commits since last tag"} ActionHistory = &Action{Key: "history", Title: "History", Description: "Visualize the git history"} )
View Source
var ResultFields = []string{"Project", "Status", "Data", "Error"}
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Key string `json:"key"` Title string `json:"title"` Description string `json:"description"` }
func ActionStatusFromString ¶
type HistoryArgs ¶ added in v1.5.5
type HistoryEntries ¶
type HistoryEntries []*HistoryEntry
func ParseResultsDelimited ¶
func ParseResultsDelimited(output string) (HistoryEntries, error)
func (HistoryEntries) Get ¶
func (h HistoryEntries) Get(sha string) *HistoryEntry
type HistoryEntry ¶
type HistoryEntry struct { Headers util.ValueMap `json:"headers" xml:"headers"` SHA string `json:"sha" xml:"sha"` AuthorName string `json:"authorName" xml:"authorName"` AuthorEmail string `json:"authorEmail" xml:"authorEmail"` Message string `json:"message" xml:"message"` Occurred time.Time `json:"occurred" xml:"occurred"` Files HistoryFiles `json:"files" xml:"files"` }
type HistoryFile ¶
type HistoryFiles ¶
type HistoryFiles []*HistoryFile
type HistoryResult ¶
type HistoryResult struct { Args *HistoryArgs `json:"args,omitempty"` Entries HistoryEntries `json:"entries"` Debug any `json:"debug,omitempty"` }
type Result ¶
type Result struct { Project string `json:"project"` Status string `json:"status"` Data util.ValueMap `json:"data"` Error string `json:"error"` }
func (*Result) DataString ¶
func (*Result) DataStringArray ¶
func (*Result) History ¶
func (r *Result) History() *HistoryResult
Click to show internal directories.
Click to hide internal directories.