Documentation ¶
Index ¶
Constants ¶
View Source
const Gitlabdotcom = "https://gitlab.com"
View Source
const SettingButtonsTeam = "team"
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrForbidden = errors.New("access forbidden") ErrPrivateResource = errors.New("private resource") )
Errors returned by this package.
Functions ¶
func PrettyError ¶ added in v1.5.0
PrettyError returns an err in a better readable way.
Types ¶
type AddWebhookOptions ¶ added in v1.2.0
type AddWebhookOptions struct { URL string ConfidentialNoteEvents bool PushEvents bool IssuesEvents bool ConfidentialIssuesEvents bool MergeRequestsEvents bool TagPushEvents bool NoteEvents bool JobEvents bool PipelineEvents bool WikiPageEvents bool EnableSSLVerification bool Token string }
AddWebhookOptions is a paramater object with options for creating a project or group hook.
type Gitlab ¶
type Gitlab interface { GitlabConnect(token oauth2.Token) (*internGitlab.Client, error) GetCurrentUser(ctx context.Context, userID string, token oauth2.Token) (*UserInfo, error) GetIssueByID(ctx context.Context, user *UserInfo, owner, repo string, issueID int, token *oauth2.Token) (*Issue, error) GetMergeRequestByID(ctx context.Context, user *UserInfo, owner, repo string, mergeRequestID int, token *oauth2.Token) (*MergeRequest, error) GetUserDetails(ctx context.Context, user *UserInfo, token *oauth2.Token) (*internGitlab.User, error) GetProject(ctx context.Context, user *UserInfo, token *oauth2.Token, owner, repo string) (*internGitlab.Project, error) GetYourPrDetails(ctx context.Context, log logger.Logger, user *UserInfo, token *oauth2.Token, prList []*PRDetails) ([]*PRDetails, error) GetReviews(ctx context.Context, user *UserInfo, client *internGitlab.Client) ([]*MergeRequest, error) GetYourAssignedPrs(ctx context.Context, user *UserInfo, client *internGitlab.Client) ([]*MergeRequest, error) GetLHSData(ctx context.Context, user *UserInfo, token *oauth2.Token) (*LHSContent, error) GetYourAssignedIssues(ctx context.Context, user *UserInfo, client *internGitlab.Client) ([]*Issue, error) GetToDoList(ctx context.Context, user *UserInfo, client *internGitlab.Client) ([]*internGitlab.Todo, error) GetProjectHooks(ctx context.Context, user *UserInfo, token *oauth2.Token, owner string, repo string) ([]*WebhookInfo, error) GetGroupHooks(ctx context.Context, user *UserInfo, token *oauth2.Token, owner string) ([]*WebhookInfo, error) NewProjectHook(ctx context.Context, user *UserInfo, token *oauth2.Token, projectID interface{}, projectHookOptions *AddWebhookOptions) (*WebhookInfo, error) NewGroupHook(ctx context.Context, user *UserInfo, token *oauth2.Token, groupName string, groupHookOptions *AddWebhookOptions) (*WebhookInfo, error) TriggerProjectPipeline(userInfo *UserInfo, token *oauth2.Token, projectID string, ref string) (*PipelineInfo, error) // ResolveNamespaceAndProject accepts full path to User, Group or namespaced Project and returns corresponding // namespace and project name. // // ErrNotFound will be returned if no resource can be found. // If allowPrivate is set to false, and resolved group/project is private, ErrPrivateResource will be returned. ResolveNamespaceAndProject( ctx context.Context, userInfo *UserInfo, token *oauth2.Token, fullPath string, allowPrivate bool, ) (namespace string, project string, err error) }
Gitlab is a client to call GitLab api see New() to build one
type Issue ¶ added in v1.7.0
type Issue struct { *internGitlab.Issue LabelsWithDetails []*internGitlab.Label `json:"labels_with_details,omitempty"` }
type LHSContent ¶ added in v1.8.0
type LHSContent struct { AssignedPRs []*MergeRequest `json:"yourAssignedPrs"` Reviews []*MergeRequest `json:"reviews"` AssignedIssues []*Issue `json:"yourAssignedIssues"` Todos []*internGitlab.Todo `json:"todos"` }
type MergeRequest ¶ added in v1.7.0
type MergeRequest struct { *internGitlab.MergeRequest LabelsWithDetails []*internGitlab.Label `json:"labels_with_details,omitempty"` }
type PRDetails ¶ added in v1.7.0
type PRDetails struct { IID int `json:"iid"` Status *internGitlab.BuildStateValue `json:"status"` SHA string `json:"sha"` NumApprovers int `json:"num_approvers"` ProjectID int `json:"project_id"` }
type PipelineInfo ¶ added in v1.6.0
type PipelineInfo struct { PipelineID int Status string Ref string WebURL string SHA string User string }
PipelineInfo is the struct describing the status of a running pipeline.
type PipelineJobInfo ¶ added in v1.6.0
PipelineJobInfo is the struct describing the status of a running Job which is part of a pipeline
type UserSettings ¶
type WebhookInfo ¶ added in v1.2.0
type WebhookInfo struct { ID int URL string ConfidentialNoteEvents bool PushEvents bool IssuesEvents bool ConfidentialIssuesEvents bool MergeRequestsEvents bool TagPushEvents bool NoteEvents bool JobEvents bool PipelineEvents bool WikiPageEvents bool EnableSSLVerification bool CreatedAt *time.Time Scope Scope }
WebhookInfo Provides information about group or project hooks.
func (*WebhookInfo) String ¶ added in v1.2.0
func (w *WebhookInfo) String() string
String produces a multiline bulleted string for displaying webhook information.
Click to show internal directories.
Click to hide internal directories.