Documentation ¶
Index ¶
- Variables
- func ColorStatus(in string) string
- func CommitBody(commithash string) (string, error)
- func CommitSubject(commithash string) (string, error)
- func Confirm() bool
- func CurrentBranch() (string, error)
- func CurrentCommitHash() (string, error)
- func CurrentCommitHashOnTrackingUpstream() (string, error)
- func CurrentTrackingBranch() (string, error)
- func EditInEditor(source string) (out string, err error)
- func FindJobIdByName(jobs []Job, name string) int64
- func GETEndpointRaw(instance *config.Instance, endpoint string) (resp *http.Response, err error)
- func GetRemoteURLByName(name string) (string, error)
- func Git(arg ...string) (string, error)
- func GitRoot() (string, error)
- func InstanceForHostname(conf *config.Config, hostname string) (*config.Instance, error)
- func InstanceForRepo(conf *config.Config, repoPath string) (*config.Instance, string, error)
- func InstanceForURL(conf *config.Config, url string) (instance *config.Instance, returnUrl string, err error)
- func InstanceSupportsFeature(instance *config.Instance, features ...string) bool
- func InstanceVersion(instance *config.Instance) (version string, err error)
- func IsGitVersionGreaterOrEqual(version string) bool
- func NewAuthenticatedAPIRequest(instance *config.Instance, method string, endpoint string, body io.Reader) (req *http.Request, err error)
- func NewAuthenticatedJSONAPIRequest(instance *config.Instance, method string, endpoint string, payload interface{}, ...) (resp *http.Response, err error)
- func NewAuthenticatedJSONRequest(instance *config.Instance, method string, path string, payload interface{}, ...) (resp *http.Response, err error)
- func NewAuthenticatedRequest(instance *config.Instance, method string, path string, body io.Reader) (req *http.Request, err error)
- func PipelinesMatchingCommit(instance *config.Instance, projectId int64, commit string) (pipelines []int64, err error)
- func Version() (string, error)
- type Issue
- type Job
- func CancelJob(instance *config.Instance, projectId int64, jobId int64) (job *Job, err error)
- func GetJob(instance *config.Instance, projectId int64, jobId int64) (job Job, err error)
- func JobsByPipeline(instance *config.Instance, projectId int64, pipelineID int64) (jobs []Job, err error)
- func RetryJob(instance *config.Instance, projectId int64, jobId int64) (job *Job, err error)
- func TriggerJob(instance *config.Instance, projectId int64, jobId int64, endpoint string) (job *Job, err error)
- func TriggerManualJob(instance *config.Instance, projectId int64, jobId int64) (job *Job, err error)
- type MergeRequest
- type MergeRequestResponse
- type Milestone
- type PipelineRequest
- type PipelineVariable
- type Project
- type Todo
- type User
Constants ¶
This section is empty.
Variables ¶
var ErrAPIError = errors.New("API error")
var ErrFeature = errors.New("required feature is not supported by the affected GitLab instance")
var ErrGit = errors.New("git command failed")
var ErrNoInstance = errors.New("no instance matched")
var ErrNotManual = errors.New("job to be triggered is not a manual job or already running")
Functions ¶
func ColorStatus ¶
func CommitBody ¶
* CommitSubject returns the body of a commit
func CommitSubject ¶
* CommitSubject returns the subject of a commit
func Confirm ¶
func Confirm() bool
*
- Returns true if the user confirmed, false otherwise.
- You need to print the query string yourself!
func CurrentBranch ¶
* CurrentBranch returns the current branch of the current repository
func CurrentCommitHash ¶
* CurrentCommitHash returns the current commit of the current repository
func CurrentCommitHashOnTrackingUpstream ¶
* CurrentCommitHashOnTrackingUpstream returns the current commit of the current tracking upstream
func CurrentTrackingBranch ¶
func EditInEditor ¶
func FindJobIdByName ¶
func GETEndpointRaw ¶
* GETEndpoint is a helper to execute authorized GET calls to the API of the provided instance.
func GetRemoteURLByName ¶
func InstanceForHostname ¶
func InstanceForRepo ¶
* InstanceForRepo returns the instance from the configuration that is applicable fot the repository passed in.
func InstanceForURL ¶
func InstanceForURL(conf *config.Config, url string) (instance *config.Instance, returnUrl string, err error)
* InstanceForRepo returns the instance and URL path for the url passed in.
func InstanceSupportsFeature ¶
func NewAuthenticatedRequest ¶
Types ¶
type Issue ¶
type Issue struct { ID int64 `json:"id"` IID int64 `json:"iid"` ProjectId int64 `json:"project_id"` State string `json:"state"` Title string `json:"title"` Description string `json:"description"` Author User `json:"author"` Assignees []User `json:"assignees,omitempty"` Assignee User `json:"assignee,omitempty"` //Deprecated on API level Milestone Milestone `json:"milestone"` Labels []string `json:"labels"` WebURL string `json:"web_url"` Confidential bool `json:"confidential"` }
func GetAssignedIssues ¶
* ProjectByPath returns the project of a project path/namespace.
type Job ¶
type Job struct { ID int64 `json:"id"` Name string `json:"name"` Stage string `json:"stage"` Status string `json:"status"` }
func JobsByPipeline ¶
func TriggerJob ¶
type MergeRequest ¶
type MergeRequestResponse ¶
type MergeRequestResponse struct { MergeRequest IId int64 `json:"iid"` WebURL string `json:"web_url"` }
func CreateMergeRequest ¶
func CreateMergeRequest(instance *config.Instance, projectID int64, mr *MergeRequest) (mrr *MergeRequestResponse, err error)
type PipelineRequest ¶
type PipelineRequest struct { Ref string `json:"ref"` Variables []PipelineVariable `json:"variables"` }
type PipelineVariable ¶
type Project ¶
type Project struct { ID int64 `json:"id"` Name string `json:"name"` NameWithNamespace string `json:"name_with_namespace"` PathWithNamespace string `json:"path_with_namespace"` SSHURL string `json:"ssh_url_to_repo"` HTTPURL string `json:"http_url_to_repo"` WebURL string `json:"web_url"` Visibility string `json:"visibility"` DefaultBranch string `json:"default_branch"` Archived bool `json:"archived"` }
func ProjectByID ¶
* ProjectByID returns the project of a project id.
type Todo ¶
type Todo struct { ID int64 `json:"id"` Project struct { Id int64 `json:"id"` NameWithNamespace string `json:"name_with_namespace"` } `json:"project"` //This is because of stupid API design Author User `json:"author"` ActionName string `json:"action_name"` TargetType string `json:"target_type"` Target struct{} `json:"target"` //TODO TargetURL string `json:"target_url"` Body string `json:"body"` State string `json:"state"` CreatedAt string `json:"created_at"` }