gitlabdata

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2019 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLevelValue

type AccessLevelValue int

AccessLevelValue represents a permission level within GitLab.

GitLab API docs: https://docs.gitlab.com/ce/permissions/permissions.html

const (
	NoPermissions         AccessLevelValue = 0
	GuestPermissions      AccessLevelValue = 10
	ReporterPermissions   AccessLevelValue = 20
	DeveloperPermissions  AccessLevelValue = 30
	MaintainerPermissions AccessLevelValue = 40
	OwnerPermissions      AccessLevelValue = 50

	// These are deprecated and should be removed in a future version
	MasterPermissions AccessLevelValue = 40
	OwnerPermission   AccessLevelValue = 50
)

List of available access levels

GitLab API docs: https://docs.gitlab.com/ce/permissions/permissions.html

type BuildStateValue

type BuildStateValue string

BuildStateValue represents a GitLab build state.

const (
	Pending  BuildStateValue = "pending"
	Running  BuildStateValue = "running"
	Success  BuildStateValue = "success"
	Failed   BuildStateValue = "failed"
	Canceled BuildStateValue = "canceled"
	Skipped  BuildStateValue = "skipped"
)

These constants represent all valid build states.

type Commit

type Commit struct {
	ID             string           `json:"id"`
	ShortID        string           `json:"short_id"`
	Title          string           `json:"title"`
	AuthorName     string           `json:"author_name"`
	AuthorEmail    string           `json:"author_email"`
	AuthoredDate   string           `json:"authored_date"`
	CommitterName  string           `json:"committer_name"`
	CommitterEmail string           `json:"committer_email"`
	CommittedDate  string           `json:"committed_date"`
	CreatedAt      string           `json:"created_at"`
	Message        string           `json:"message"`
	ParentIDs      []string         `json:"parent_ids"`
	Stats          *CommitStats     `json:"stats"`
	Status         *BuildStateValue `json:"status"`
}

Commit represents a GitLab commit.

GitLab API docs: https://docs.gitlab.com/ce/api/commits.html

type CommitStats

type CommitStats struct {
	Additions int `json:"additions"`
	Deletions int `json:"deletions"`
	Total     int `json:"total"`
}

CommitStats represents the number of added and deleted files in a commit.

GitLab API docs: https://docs.gitlab.com/ce/api/commits.html

type CustomAttribute

type CustomAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

CustomAttribute struct is used to unmarshal response to api calls.

GitLab API docs: https://docs.gitlab.com/ce/api/custom_attributes.html

type EventTargetTypeValue

type EventTargetTypeValue string

EventTargetTypeValue represents actions type value for contribution events

const (
	IssueEventTargetType        EventTargetTypeValue = "issue"
	MilestoneEventTargetType    EventTargetTypeValue = "milestone"
	MergeRequestEventTargetType EventTargetTypeValue = "merge_request"
	NoteEventTargetType         EventTargetTypeValue = "note"
	ProjectEventTargetType      EventTargetTypeValue = "project"
	SnippetEventTargetType      EventTargetTypeValue = "snippet"
	UserEventTargetType         EventTargetTypeValue = "user"
)

List of available action type

GitLab API docs: https://docs.gitlab.com/ce/api/events.html#target-types

type EventTypeValue

type EventTypeValue string

EventTypeValue represents actions type for contribution events

const (
	CreatedEventType   EventTypeValue = "created"
	UpdatedEventType   EventTypeValue = "updated"
	ClosedEventType    EventTypeValue = "closed"
	ReopenedEventType  EventTypeValue = "reopened"
	PushedEventType    EventTypeValue = "pushed"
	CommentedEventType EventTypeValue = "commented"
	MergedEventType    EventTypeValue = "merged"
	JoinedEventType    EventTypeValue = "joined"
	LeftEventType      EventTypeValue = "left"
	DestroyedEventType EventTypeValue = "destroyed"
	ExpiredEventType   EventTypeValue = "expired"
)

List of available action type

GitLab API docs: https://docs.gitlab.com/ce/api/events.html#action-types

type ForkParent

type ForkParent struct {
	HTTPURLToRepo     string `json:"http_url_to_repo"`
	ID                int    `json:"id"`
	Name              string `json:"name"`
	NameWithNamespace string `json:"name_with_namespace"`
	Path              string `json:"path"`
	PathWithNamespace string `json:"path_with_namespace"`
	WebURL            string `json:"web_url"`
}

ForkParent represents the parent project when this is a fork.

type GroupAccess

type GroupAccess struct {
	AccessLevel       AccessLevelValue       `json:"access_level"`
	NotificationLevel NotificationLevelValue `json:"notification_level"`
}

GroupAccess represents group access.

type ISOTime

type ISOTime time.Time

ISOTime represents an ISO 8601 formatted date

type Links struct {
	Self          string `json:"self"`
	Issues        string `json:"issues"`
	MergeRequests string `json:"merge_requests"`
	RepoBranches  string `json:"repo_branches"`
	Labels        string `json:"labels"`
	Events        string `json:"events"`
	Members       string `json:"members"`
}

Links represents a project web links for self, issues, merge_requests, repo_branches, labels, events, members.

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty" json:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty" json:"per_page,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type ListProjectsOptions

type ListProjectsOptions struct {
	ListOptions
	Archived                 *bool             `url:"archived,omitempty" json:"archived,omitempty"`
	OrderBy                  *string           `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort                     *string           `url:"sort,omitempty" json:"sort,omitempty"`
	Search                   *string           `url:"search,omitempty" json:"search,omitempty"`
	Simple                   *bool             `url:"simple,omitempty" json:"simple,omitempty"`
	Owned                    *bool             `url:"owned,omitempty" json:"owned,omitempty"`
	Membership               *bool             `url:"membership,omitempty" json:"membership,omitempty"`
	Starred                  *bool             `url:"starred,omitempty" json:"starred,omitempty"`
	Statistics               *bool             `url:"statistics,omitempty" json:"statistics,omitempty"`
	Visibility               *VisibilityValue  `url:"visibility,omitempty" json:"visibility,omitempty"`
	WithIssuesEnabled        *bool             `url:"with_issues_enabled,omitempty" json:"with_issues_enabled,omitempty"`
	WithMergeRequestsEnabled *bool             `url:"with_merge_requests_enabled,omitempty" json:"with_merge_requests_enabled,omitempty"`
	MinAccessLevel           *AccessLevelValue `url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
	WithCustomAttributes     *bool             `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
}

ListProjectsOptions represents the available ListProjects() options.

GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#list-projects

type ListUsersOptions

type ListUsersOptions struct {
	ListOptions
	Active  *bool `url:"active,omitempty" json:"active,omitempty"`
	Blocked *bool `url:"blocked,omitempty" json:"blocked,omitempty"`

	// The options below are only available for admins.
	Search               *string    `url:"search,omitempty" json:"search,omitempty"`
	Username             *string    `url:"username,omitempty" json:"username,omitempty"`
	ExternalUID          *string    `url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
	Provider             *string    `url:"provider,omitempty" json:"provider,omitempty"`
	CreatedBefore        *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
	CreatedAfter         *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
	OrderBy              *string    `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort                 *string    `url:"sort,omitempty" json:"sort,omitempty"`
	WithCustomAttributes *bool      `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
}

ListUsersOptions represents the available ListUsers() options.

GitLab API docs: https://docs.gitlab.com/ce/api/users.html#list-users

type MergeMethodValue

type MergeMethodValue string

MergeMethodValue represents a project merge type within GitLab.

GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#project-merge-method

const (
	NoFastForwardMerge MergeMethodValue = "merge"
	FastForwardMerge   MergeMethodValue = "ff"
	RebaseMerge        MergeMethodValue = "rebase_merge"
)

List of available merge type

GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#project-merge-method

type NotificationLevelValue

type NotificationLevelValue int

NotificationLevelValue represents a notification level.

const (
	DisabledNotificationLevel NotificationLevelValue = iota
	ParticipatingNotificationLevel
	WatchNotificationLevel
	GlobalNotificationLevel
	MentionNotificationLevel
	CustomNotificationLevel
)

List of valid notification levels.

func (NotificationLevelValue) MarshalJSON

func (l NotificationLevelValue) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (NotificationLevelValue) String

func (l NotificationLevelValue) String() string

String implements the fmt.Stringer interface.

func (*NotificationLevelValue) UnmarshalJSON

func (l *NotificationLevelValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Permissions

type Permissions struct {
	ProjectAccess *ProjectAccess `json:"project_access"`
	GroupAccess   *GroupAccess   `json:"group_access"`
}

Permissions represents permissions.

type Project

type Project struct {
	ID                                        int               `json:"id"`
	Description                               string            `json:"description"`
	DefaultBranch                             string            `json:"default_branch"`
	Public                                    bool              `json:"public"`
	Visibility                                VisibilityValue   `json:"visibility"`
	SSHURLToRepo                              string            `json:"ssh_url_to_repo"`
	HTTPURLToRepo                             string            `json:"http_url_to_repo"`
	WebURL                                    string            `json:"web_url"`
	ReadmeURL                                 string            `json:"readme_url"`
	TagList                                   []string          `json:"tag_list"`
	Owner                                     *User             `json:"owner"`
	Name                                      string            `json:"name"`
	NameWithNamespace                         string            `json:"name_with_namespace"`
	Path                                      string            `json:"path"`
	PathWithNamespace                         string            `json:"path_with_namespace"`
	IssuesEnabled                             bool              `json:"issues_enabled"`
	OpenIssuesCount                           int               `json:"open_issues_count"`
	MergeRequestsEnabled                      bool              `json:"merge_requests_enabled"`
	ApprovalsBeforeMerge                      int               `json:"approvals_before_merge"`
	JobsEnabled                               bool              `json:"jobs_enabled"`
	WikiEnabled                               bool              `json:"wiki_enabled"`
	SnippetsEnabled                           bool              `json:"snippets_enabled"`
	ContainerRegistryEnabled                  bool              `json:"container_registry_enabled"`
	CreatedAt                                 *time.Time        `json:"created_at,omitempty"`
	LastActivityAt                            *time.Time        `json:"last_activity_at,omitempty"`
	CreatorID                                 int               `json:"creator_id"`
	Namespace                                 *ProjectNamespace `json:"namespace"`
	ImportStatus                              string            `json:"import_status"`
	ImportError                               string            `json:"import_error"`
	Permissions                               *Permissions      `json:"permissions"`
	Archived                                  bool              `json:"archived"`
	AvatarURL                                 string            `json:"avatar_url"`
	SharedRunnersEnabled                      bool              `json:"shared_runners_enabled"`
	ForksCount                                int               `json:"forks_count"`
	StarCount                                 int               `json:"star_count"`
	RunnersToken                              string            `json:"runners_token"`
	PublicBuilds                              bool              `json:"public_builds"`
	OnlyAllowMergeIfPipelineSucceeds          bool              `json:"only_allow_merge_if_pipeline_succeeds"`
	OnlyAllowMergeIfAllDiscussionsAreResolved bool              `json:"only_allow_merge_if_all_discussions_are_resolved"`
	LFSEnabled                                bool              `json:"lfs_enabled"`
	RequestAccessEnabled                      bool              `json:"request_access_enabled"`
	MergeMethod                               MergeMethodValue  `json:"merge_method"`
	ForkedFromProject                         *ForkParent       `json:"forked_from_project"`
	Mirror                                    bool              `json:"mirror"`
	MirrorUserID                              int               `json:"mirror_user_id"`
	MirrorTriggerBuilds                       bool              `json:"mirror_trigger_builds"`
	OnlyMirrorProtectedBranches               bool              `json:"only_mirror_protected_branches"`
	MirrorOverwritesDivergedBranches          bool              `json:"mirror_overwrites_diverged_branches"`
	SharedWithGroups                          []struct {
		GroupID          int    `json:"group_id"`
		GroupName        string `json:"group_name"`
		GroupAccessLevel int    `json:"group_access_level"`
	} `json:"shared_with_groups"`
	Statistics       *ProjectStatistics `json:"statistics"`
	Links            *Links             `json:"_links,omitempty"`
	CIConfigPath     *string            `json:"ci_config_path"`
	CustomAttributes []*CustomAttribute `json:"custom_attributes"`
}

Project represents a GitLab project.

GitLab API docs: https://docs.gitlab.com/ce/api/projects.html

type ProjectAccess

type ProjectAccess struct {
	AccessLevel       AccessLevelValue       `json:"access_level"`
	NotificationLevel NotificationLevelValue `json:"notification_level"`
}

ProjectAccess represents project access.

type ProjectNamespace

type ProjectNamespace struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Path     string `json:"path"`
	Kind     string `json:"kind"`
	FullPath string `json:"full_path"`
}

ProjectNamespace represents a project namespace.

type ProjectStatistics

type ProjectStatistics struct {
	StorageStatistics
	CommitCount int `json:"commit_count"`
}

ProjectStatistics represents a statistics record for a project.

type Release

type Release struct {
	TagName     string `json:"tag_name"`
	Description string `json:"description"`
}

Release represents a GitLab version release.

GitLab API docs: https://docs.gitlab.com/ce/api/tags.html

type Repository

type Repository struct {
	Name              string          `json:"name"`
	Description       string          `json:"description"`
	WebURL            string          `json:"web_url"`
	AvatarURL         string          `json:"avatar_url"`
	GitSSHURL         string          `json:"git_ssh_url"`
	GitHTTPURL        string          `json:"git_http_url"`
	Namespace         string          `json:"namespace"`
	Visibility        VisibilityValue `json:"visibility"`
	PathWithNamespace string          `json:"path_with_namespace"`
	DefaultBranch     string          `json:"default_branch"`
	Homepage          string          `json:"homepage"`
	URL               string          `json:"url"`
	SSHURL            string          `json:"ssh_url"`
	HTTPURL           string          `json:"http_url"`
}

Repository represents a repository.

type StorageStatistics

type StorageStatistics struct {
	StorageSize      int64 `json:"storage_size"`
	RepositorySize   int64 `json:"repository_size"`
	LfsObjectsSize   int64 `json:"lfs_objects_size"`
	JobArtifactsSize int64 `json:"job_artifacts_size"`
}

StorageStatistics represents a statistics record for a group or project.

type Tag

type Tag struct {
	Commit  *Commit  `json:"commit"`
	Release *Release `json:"release"`
	Name    string   `json:"name"`
	Message string   `json:"message"`
}

Tag represents a GitLab tag.

GitLab API docs: https://docs.gitlab.com/ce/api/tags.html

type User

type User struct {
	ID                        int                `json:"id"`
	Username                  string             `json:"username"`
	Email                     string             `json:"email"`
	Name                      string             `json:"name"`
	State                     string             `json:"state"`
	CreatedAt                 *time.Time         `json:"created_at"`
	Bio                       string             `json:"bio"`
	Location                  string             `json:"location"`
	PublicEmail               string             `json:"public_email"`
	Skype                     string             `json:"skype"`
	Linkedin                  string             `json:"linkedin"`
	Twitter                   string             `json:"twitter"`
	WebsiteURL                string             `json:"website_url"`
	Organization              string             `json:"organization"`
	ExternUID                 string             `json:"extern_uid"`
	Provider                  string             `json:"provider"`
	ThemeID                   int                `json:"theme_id"`
	LastActivityOn            *ISOTime           `json:"last_activity_on"`
	ColorSchemeID             int                `json:"color_scheme_id"`
	IsAdmin                   bool               `json:"is_admin"`
	AvatarURL                 string             `json:"avatar_url"`
	CanCreateGroup            bool               `json:"can_create_group"`
	CanCreateProject          bool               `json:"can_create_project"`
	ProjectsLimit             int                `json:"projects_limit"`
	CurrentSignInAt           *time.Time         `json:"current_sign_in_at"`
	LastSignInAt              *time.Time         `json:"last_sign_in_at"`
	ConfirmedAt               *time.Time         `json:"confirmed_at"`
	TwoFactorEnabled          bool               `json:"two_factor_enabled"`
	Identities                []*UserIdentity    `json:"identities"`
	External                  bool               `json:"external"`
	PrivateProfile            bool               `json:"private_profile"`
	SharedRunnersMinutesLimit int                `json:"shared_runners_minutes_limit"`
	CustomAttributes          []*CustomAttribute `json:"custom_attributes"`
}

User represents a GitLab user.

GitLab API docs: https://docs.gitlab.com/ee/api/users.html

type UserIdentity

type UserIdentity struct {
	Provider  string `json:"provider"`
	ExternUID string `json:"extern_uid"`
}

UserIdentity represents a user identity.

type VisibilityValue

type VisibilityValue string

VisibilityValue represents a visibility level within GitLab.

GitLab API docs: https://docs.gitlab.com/ce/api/

const (
	PrivateVisibility  VisibilityValue = "private"
	InternalVisibility VisibilityValue = "internal"
	PublicVisibility   VisibilityValue = "public"
)

List of available visibility levels

GitLab API docs: https://docs.gitlab.com/ce/api/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL