Documentation
¶
Index ¶
- Variables
- type Config
- type CreateBranchRequest
- type CreateBranchResult
- type CreateIssueRequest
- type CreateIssueResult
- type CreateMergeRequest
- type CreateMergeResult
- type CreateMilestoneRequest
- type CreateMilestoneResult
- type GetMilestoneIssuesRequest
- type GetMilestoneIssuesResult
- type GetMilestoneMergeRequestsRequest
- type GetMilestoneMergeRequestsResult
- type GetMilestoneRequest
- type GetMilestoneResult
- type IGitlabOauth2Support
- type IGitlabOperator
- type IssueShort
- type ListMilestoneRequest
- type ListMilestoneResult
- type ListProjectRequest
- type ListProjectResult
- type MergeMergeRequest
- type MergeRequestShort
- type MilestoneShort
- type OAuth2Config
- type ProjectShort
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SecretKey is used to encrypt and decrypt access token and refresh token. // NOTE: this key must be 8 bytes long. SecretKey = "aflowcli" )
Functions ¶
This section is empty.
Types ¶
type CreateBranchRequest ¶
CreateBranchRequest
type CreateBranchResult ¶
type CreateIssueRequest ¶
CreateIssueRequest
type CreateIssueResult ¶
type CreateMergeRequest ¶
type CreateMergeRequest struct {
Title, Desc, SrcBranch, TargetBranch string
MilestoneID, IssueIID int
ProjectID int
AutoMerge bool
}
CreateMergeRequest
type CreateMergeResult ¶
type CreateMilestoneRequest ¶
CreateMilestoneRequest
type CreateMilestoneResult ¶
type GetMilestoneIssuesRequest ¶
GetMilestoneIssuesRequest
type GetMilestoneIssuesResult ¶
type GetMilestoneIssuesResult struct {
Data []IssueShort
}
type GetMilestoneMergeRequestsRequest ¶
GetMilestoneMergeRequestsRequest
type GetMilestoneMergeRequestsResult ¶
type GetMilestoneMergeRequestsResult struct {
Data []MergeRequestShort
}
type GetMilestoneRequest ¶
GetMilestoneRequest .
type GetMilestoneResult ¶
type IGitlabOauth2Support ¶ added in v1.7.0
type IGitlabOauth2Support interface {
// Enter is an asynchronous process that would not return accessToken and refreshToken synchronized.
// IGitlabOauth2Support.Load will return the refreshToken and accessToken after signaling.
Enter(refreshToken string) (err error)
// Load only uses this after any signal from Enter channel. Blocked method.
Load() (accessToken, refreshToken string)
}
func NewOAuth2Support ¶ added in v1.7.0
func NewOAuth2Support(c *OAuth2Config) IGitlabOauth2Support
type IGitlabOperator ¶
type IGitlabOperator interface {
// CreateBranch create a branch on remote gitlab repository, but this would check remote
// resource if create failed.
CreateBranch(ctx context.Context, req *CreateBranchRequest) (*CreateBranchResult, error)
// CreateMilestone create a milestone on remote gitlab repository, but this would check remote
// resource if create failed.
CreateMilestone(ctx context.Context, req *CreateMilestoneRequest) (*CreateMilestoneResult, error)
GetMilestone(ctx context.Context, req *GetMilestoneRequest) (*GetMilestoneResult, error)
GetMilestoneMergeRequests(
ctx context.Context, req *GetMilestoneMergeRequestsRequest) (*GetMilestoneMergeRequestsResult, error)
GetMilestoneIssues(ctx context.Context, req *GetMilestoneIssuesRequest) (*GetMilestoneIssuesResult, error)
// CreateIssue create an issue on remote repository, but this would check remote
// resource if create failed.
CreateIssue(ctx context.Context, req *CreateIssueRequest) (*CreateIssueResult, error)
// CreateMergeRequest create an merge request on remote repository, but this would check remote
// resource if create failed.
CreateMergeRequest(ctx context.Context, req *CreateMergeRequest) (*CreateMergeResult, error)
MergeMergeRequest(ctx context.Context, req *MergeMergeRequest) error
ListMilestones(ctx context.Context, req *ListMilestoneRequest) (*ListMilestoneResult, error)
ListProjects(ctx context.Context, req *ListProjectRequest) (*ListProjectResult, error)
}
IGitlabOperator contains all operations those manage repository, milestones, branch, issue and merge requests.
func NewGitlabOperator ¶
func NewGitlabOperator(accessToken, apiURL string) IGitlabOperator
NewGitlabOperator generate IGitlabOperator.
type IssueShort ¶
type ListMilestoneRequest ¶
ListMilestoneRequest
type ListMilestoneResult ¶
type ListMilestoneResult struct {
Data []MilestoneShort
}
type ListProjectRequest ¶
type ListProjectResult ¶
type ListProjectResult struct {
Data []ProjectShort
}
type MergeMergeRequest ¶ added in v1.9.0
type MergeRequestShort ¶
type MilestoneShort ¶
type OAuth2Config ¶ added in v1.7.0
type OAuth2Config struct {
// Host of gitlab code repository web application, such as https://git.example.com
Host string
// ServeAddr indicates which port will gitlabOAuth2Support will listen
// to receive callback request from gitlab oauth server.
ServeAddr string
// AppID and AppSecret are application id and secret of gitlab oauth2 application.
AppID, AppSecret string
// AccessToken, RefreshToken represent tokens stored before,
// if they are empty, means authorization is needed.
AccessToken, RefreshToken string
// Scopes is a string of scopes, such as "api read_user"
Scopes string
// Mode represents the mode of OAuth2 authorization.
Mode types.OAuth2Mode
}
OAuth2Config helps construct gitlab OAuth2 support.
func NewOAuth2ConfigFrom ¶ added in v1.9.3
func NewOAuth2ConfigFrom(cfg *types.Config) *OAuth2Config
func (*OAuth2Config) CallbackURI ¶ added in v1.8.0
func (c *OAuth2Config) CallbackURI() string
type ProjectShort ¶
Click to show internal directories.
Click to hide internal directories.