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 { GetCurrentUser(ctx context.Context, userID string, token oauth2.Token) (*UserInfo, error) GetUserDetails(ctx context.Context, user *UserInfo) (*internGitlab.User, error) GetProject(ctx context.Context, user *UserInfo, owner, repo string) (*internGitlab.Project, error) GetReviews(ctx context.Context, user *UserInfo) ([]*internGitlab.MergeRequest, error) GetYourPrs(ctx context.Context, user *UserInfo) ([]*internGitlab.MergeRequest, error) GetYourAssignments(ctx context.Context, user *UserInfo) ([]*internGitlab.Issue, error) GetUnreads(ctx context.Context, user *UserInfo) ([]*internGitlab.Todo, error) GetProjectHooks(ctx context.Context, user *UserInfo, owner string, repo string) ([]*WebhookInfo, error) GetGroupHooks(ctx context.Context, user *UserInfo, owner string) ([]*WebhookInfo, error) NewProjectHook(ctx context.Context, user *UserInfo, projectID interface{}, projectHookOptions *AddWebhookOptions) (*WebhookInfo, error) NewGroupHook(ctx context.Context, user *UserInfo, groupName string, groupHookOptions *AddWebhookOptions) (*WebhookInfo, 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, fullPath string, allowPrivate bool, ) (namespace string, project string, err error) }
Gitlab is a client to call GitLab api see New() to build one
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.