Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// JobType is to select operation type that will be applied to repository
JobType Type
// Repository points to the repository that will be used for operation
Repository *git.Repository
// Options is a placeholder for operation options
Options interface{}
}
Job relates the type of the operation and the entity
type PullJobConfig ¶ added in v0.9.0
type PullJobConfig struct {
Options *command.PullOptions
SuppressSuccess bool
}
PullJobConfig wraps pull options with queue behaviour flags.
type PushJobConfig ¶ added in v0.9.0
type PushJobConfig struct {
Options *command.PushOptions
SuppressSuccess bool
AllowForce bool
}
PushJobConfig wraps push options with queue behaviour flags.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue holds the slice of Jobs
func CreateJobQueue ¶
func CreateJobQueue() (jq *Queue)
CreateJobQueue creates a jobqueue struct and initialize its slice then return its pointer
func (*Queue) IsInTheQueue ¶
func (jq *Queue) IsInTheQueue(r *git.Repository) (inTheQueue bool, j *Job)
IsInTheQueue function; since the job and entity is not tied with its own struct, this function returns true if that entity is in the queue along with the jobs type
func (*Queue) RemoveFromQueue ¶
func (jq *Queue) RemoveFromQueue(r *git.Repository) error
RemoveFromQueue deletes the given entity and its job from the queue
func (*Queue) StartJobsAsync ¶
StartJobsAsync starts all jobs in the queue asynchronously. Concurrency is limited by the git queue semaphore in internal/git/repository.go, which caps concurrent git operations globally across all repositories.
type Type ¶
type Type string
Type is the a git operation supported
const ( // FetchJob is wrapper of git fetch command FetchJob Type = "fetch" // PullJob is wrapper of git pull command PullJob Type = "pull" // MergeJob is wrapper of git merge command MergeJob Type = "merge" // RebaseJob is wrapper of git pull --rebase command RebaseJob Type = "rebase" // PushJob is wrapper of git push command PushJob Type = "push" )