Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultRequestTimeout = 5 * time.Second
DefaultRequestTimeout specifies default value for request timeouts.
View Source
const SettingButtonsTeam = "team"
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrPrivateResource = errors.New("private resource") )
Errors returned by this package.
Functions ¶
This section is empty.
Types ¶
type AddWebhookOptions ¶
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(userID string, token oauth2.Token) (*UserInfo, error)
GetUserDetails(user *UserInfo) (*internGitlab.User, error)
GetProject(user *UserInfo, owner, repo string) (*internGitlab.Project, error)
GetReviews(user *UserInfo) ([]*internGitlab.MergeRequest, error)
GetYourPrs(user *UserInfo) ([]*internGitlab.MergeRequest, error)
GetYourAssignments(user *UserInfo) ([]*internGitlab.Issue, error)
GetUnreads(user *UserInfo) ([]*internGitlab.Todo, error)
GetProjectHooks(user *UserInfo, owner string, repo string) ([]*WebhookInfo, error)
GetGroupHooks(user *UserInfo, owner string) ([]*WebhookInfo, error)
NewProjectHook(user *UserInfo, projectID interface{}, projectHookOptions *AddWebhookOptions) (*WebhookInfo, error)
NewGroupHook(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(
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 ¶
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 ¶
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.