scm

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Permissions = map[gitlab.AccessLevelValue]ProjectPermissions{
	gitlab.OwnerPermission:      {MetaName: "admin", RoleRefName: "admin", AccessLevelValue: 50},
	gitlab.MasterPermissions:    {MetaName: "admin", RoleRefName: "view", AccessLevelValue: 40},
	gitlab.DeveloperPermissions: {MetaName: "edit-hptg8", RoleRefName: "view", AccessLevelValue: 30},
	gitlab.ReporterPermissions:  {MetaName: "view-gbtpw", RoleRefName: "view", AccessLevelValue: 20},
	gitlab.GuestPermissions:     {MetaName: "view-gbtpw", RoleRefName: "view", AccessLevelValue: 10},
}

Functions

This section is empty.

Types

type Group

type Group struct {
	ID                   int        `json:"id"`
	Name                 string     `json:"name"`
	Path                 string     `json:"path"`
	Description          string     `json:"description"`
	LFSEnabled           bool       `json:"lfs_enabled"`
	AvatarURL            string     `json:"avatar_url"`
	WebURL               string     `json:"web_url"`
	RequestAccessEnabled bool       `json:"request_access_enabled"`
	FullName             string     `json:"full_name"`
	FullPath             string     `json:"full_path"`
	ParentID             int        `json:"parent_id"`
	Projects             []*Project `json:"projects"`
	AccessLevelValue     int        `json:"access_level_value"`
	Page                 int        `json:"page"`
}

type GroupInterface

type GroupInterface interface {
	ListGroups(token, baseUrl string, page int) ([]Group, error)
	GetGroup(token, baseUrl string, gid int) (*Group, error)
	ListGroupProjects(token, baseUrl string, gid, page int) ([]Project, error)
}

type GroupMember

type GroupMember 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"`
	AccessLevelValue int        `json:"access_level_value"`
}

type GroupMemberInterface

type GroupMemberInterface interface {
	ListGroupMembers(token, baseUrl string, gid, uid int) (int, error)
	GetGroupMember(token, baseUrl string, gid, uid int) (*GroupMember, error)
}

type Project

type Project struct {
	ID                                        int        `json:"id"`
	Description                               string     `json:"description"`
	DefaultBranch                             string     `json:"default_branch"`
	Public                                    bool       `json:"public"`
	SSHURLToRepo                              string     `json:"ssh_url_to_repo"`
	HTTPURLToRepo                             string     `json:"http_url_to_repo"`
	WebURL                                    string     `json:"web_url"`
	TagList                                   []string   `json:"tag_list"`
	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"`
	ImportStatus                              string     `json:"import_status"`
	ImportError                               string     `json:"import_error"`
	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"`
	PublicJobs                                bool       `json:"public_jobs"`
	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"`
	CIConfigPath                              *string    `json:"ci_config_path"`
	AccessLevel                               int        `json:"access_level"`
	Token                                     string     `json:"token"`
	BaseUrl                                   string     `json:"base_url"`
	Namespace                                 string     `json:"namespace"`
	Page                                      int        `json:"page"`
	Search                                    string     `json:"search"`
	Group                                     *Group
	Ref                                       string `json:"ref"`
	Profile                                   string `json:"profile"`
}

type ProjectInterface

type ProjectInterface interface {
	ListProjects(baseUrl, token, search string, page int) ([]Project, error)
	GetGroupId(url, token string, pid int) (int, error)
	GetProject(baseUrl, id, token string) (int, int, error)
	Search(baseUrl, token, search string) ([]Project, error)
}

type ProjectMember

type ProjectMember struct {
	Token     string `json:"token"`
	BaseUrl   string `json:"base_url"`
	User      int    `json:"user"`
	Pid       int    `json:"pid" `
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Gid       int    `json:"gid"`
	ProjectPermissions
}

type ProjectMemberInterface

type ProjectMemberInterface interface {
	GetProjectMember(token, baseUrl string, pid, uid, gid int) (ProjectMember, error)
}

type ProjectPermissions

type ProjectPermissions struct {
	MetaName         string `json:"meta_name"`
	RoleRefName      string `json:"role_ref_name"`
	AccessLevelValue int    `json:"access_level_value"`
}

type RepositoryFileInterface

type RepositoryFileInterface interface {
	GetRepository(baseUrl, token, filePath, ref string, pid int) (string, error)
}

type RepositoryInterface

type RepositoryInterface interface {
	ListTree(baseUrl, token, ref string, pid int) ([]TreeNode, error)
}
type Search struct {
	Keyword string `json:"keyword"`
}

type Session

type Session struct {
	ID               int        `json:"id"`
	Username         string     `json:"username"`
	Email            string     `json:"email"`
	Name             string     `json:"name"`
	PrivateToken     string     `json:"private_token"`
	Blocked          bool       `json:"blocked"`
	CreatedAt        *time.Time `json:"created_at"`
	IsAdmin          bool       `json:"is_admin"`
	CanCreateGroup   bool       `json:"can_create_group"`
	CanCreateTeam    bool       `json:"can_create_team"`
	CanCreateProject bool       `json:"can_create_project"`
}

type SessionInterface

type SessionInterface interface {
	GetSession(baseUrl, username, password string) error
	GetToken() string
	GetId() int
}

type TreeNode

type TreeNode struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Path string `json:"path"`
	Mode string `json:"mode"`
}

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"`
	Skype            string     `json:"skype"`
	Linkedin         string     `json:"linkedin"`
	Twitter          string     `json:"twitter"`
	WebsiteURL       string     `json:"website_url"`
	ExternUID        string     `json:"extern_uid"`
	Provider         string     `json:"provider"`
	ThemeID          int        `json:"theme_id"`
	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"`
	TwoFactorEnabled bool       `json:"two_factor_enabled"`
}

type UserInterface

type UserInterface interface {
	GetUser(baseUrl, accessToken string) (*User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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