Documentation
¶
Index ¶
- Variables
- func Delete(client client.Client, cfg *DeleteRequest) error
- func IsConflict(client client.Client, req *IsConflictRequest) (bool, error)
- type ApproveRequest
- type ApproveResponse
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type GetRequest
- type GetResponse
- type IsConflictRequest
- type MergeRequest
- func (r *MergeRequest) Approve(req *ApproveRequest) (*ApproveResponse, error)
- func (r *MergeRequest) Create(req *CreateRequest) (*MergeRequest, error)
- func (r *MergeRequest) Delete(req *DeleteRequest) error
- func (r *MergeRequest) Get(req *GetRequest) (*MergeRequest, error)
- func (r *MergeRequest) Merge(req *MergeeRequest) (*MergeResponse, error)
- type MergeRequestImpl
- type MergeResponse
- type MergeeRequest
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ApproveConfig = &request.Config{
Action: "POST",
Resource: "projects/:project_id/merge_requests/:merge_request_id/approve",
}
View Source
var CreateConfig = &request.Config{ Action: "POST", Resource: "projects/:project_id/merge_requests", Headers: map[string]string{ "Content-Type": "application/json", }, }
View Source
var DeleteConfig = &request.Config{
Action: "DELETE",
Resource: "projects/:project_id/merge_requests/:merge_request_id",
}
View Source
var GetConfig = &request.Config{
Action: "GET",
Resource: "projects/:project_id/merge_requests/:merge_request_id",
}
View Source
var MergeConfig = &request.Config{
Action: "PUT",
Resource: "projects/:project_id/merge_requests/:merge_request_id/merge",
}
Functions ¶
func IsConflict ¶
func IsConflict(client client.Client, req *IsConflictRequest) (bool, error)
Types ¶
type ApproveRequest ¶
type ApproveResponse ¶
type ApproveResponse struct { ID int64 `json:"id"` IID int64 `json:"iid"` ProjectID int64 `json:"project_id"` Title string `json:"title"` Description string `json:"description"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // opened, closed, merged, locked State string `json:"state"` // unchecked, checking, can_be_merged, cannot_be_merged, cannot_be_merged_recheck MergeStatus string `json:"merge_status"` // Approve bool `json:"approve"` }
func Approve ¶
func Approve(client client.Client, req *ApproveRequest) (*ApproveResponse, error)
type CreateRequest ¶
type CreateRequest struct { // the id of the project RepositoryID int64 `json:"repository_id"` // the name of the project RepositoryName string `json:"repository_name"` SourceBranch string `json:"source_branch"` TargetBranch string `json:"target_branch"` Title string `json:"title"` // Description string `json:"description"` AssigneeID int64 `json:"assignee_id"` Labels string `json:"labels"` // RemoveSourceBranch bool `json:"remove_source_branch"` Squash bool `json:"squash"` }
type CreateResponse ¶
type CreateResponse = MergeRequest
func Create ¶
func Create(client client.Client, req *CreateRequest) (*CreateResponse, error)
type DeleteRequest ¶
type GetRequest ¶
type GetResponse ¶
type GetResponse = MergeRequest
func Get ¶
func Get(client client.Client, cfg *GetRequest) (*GetResponse, error)
type IsConflictRequest ¶
type MergeRequest ¶
type MergeRequest struct { // ID int64 `json:"id"` IID int64 `json:"iid"` ProjectID int64 `json:"project_id"` Title string `json:"title"` Description string `json:"description"` SourceBranch string `json:"source_branch"` TargetBranch string `json:"target_branch"` SourceProjectID int64 `json:"source_project_id"` TargetProjectID int64 `json:"target_project_id"` Labels []string `json:"labels"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` WebURL string `json:"web_url"` // Author User `json:"author"` // MergedAt time.Time `json:"merged_at"` MergedUser User `json:"merged_by"` // opened, closed, merged, locked State string `json:"state"` // unchecked, checking, can_be_merged, cannot_be_merged, cannot_be_merged_recheck MergeStatus string `json:"merge_status"` MergeError string `json:"merge_error"` HasConflicts bool `json:"has_conflicts"` // contains filtered or unexported fields }
func (*MergeRequest) Approve ¶
func (r *MergeRequest) Approve(req *ApproveRequest) (*ApproveResponse, error)
func (*MergeRequest) Create ¶
func (r *MergeRequest) Create(req *CreateRequest) (*MergeRequest, error)
func (*MergeRequest) Delete ¶
func (r *MergeRequest) Delete(req *DeleteRequest) error
func (*MergeRequest) Get ¶
func (r *MergeRequest) Get(req *GetRequest) (*MergeRequest, error)
func (*MergeRequest) Merge ¶
func (r *MergeRequest) Merge(req *MergeeRequest) (*MergeResponse, error)
type MergeRequestImpl ¶
type MergeRequestImpl interface { Create(req *CreateRequest) (*MergeRequest, error) Get(req *GetRequest) (*MergeRequest, error) Delete(req *DeleteRequest) error Approve(req *ApproveRequest) (*ApproveResponse, error) Merge(req *MergeeRequest) (*MergeResponse, error) }
func New ¶
func New(client client.Client) MergeRequestImpl
type MergeResponse ¶
type MergeResponse = MergeRequest
func Merge ¶
func Merge(client client.Client, req *MergeeRequest) (*MergeResponse, error)
type MergeeRequest ¶
type MergeeRequest struct { RepositoryID int64 `json:"repository_id"` // the name of the project RepositoryName string `json:"repository_name"` // MergeRequestID int64 `json:"merge_request_id"` // MergeCommitMessage string `json:"merge_commit_message"` // Squash bool `json:"squash"` SquashCommitMessage string `json:"squash_commit_message"` // ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"` }
Click to show internal directories.
Click to hide internal directories.