gitlab

package
v0.0.0-...-227cf50 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	UserAgent string
	// contains filtered or unexported fields
}

Client basic struct for GitLab client

func New

func New(conf *config.Config) *Client

New creates new GitLab client

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (err error)

Do requests the api and store response in struct

func (*Client) ListGroups

func (c *Client) ListGroups() ([]Group, error)

ListGroups requests list of GitLab groups

func (*Client) ListProjects

func (c *Client) ListProjects(id int) ([]Project, error)

ListProjects requests list of projects for a group

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, query map[string]string) (*http.Request, error)

NewRequest creates a new http request for GitLab api

type Group

type Group struct {
	ID                    int    `json:"id"`
	Name                  string `json:"name"`
	Path                  string `json:"path"`
	Description           string `json:"description"`
	Visibility            string `json:"visibility"`
	LFSEnable             bool   `json:"lfs_enabled"`
	Avatar                string `json:"avatar_url"`
	Web                   string `json:"web_url"`
	AccessEnable          bool   `json:"request_access_enabled"`
	FullName              string `json:"full_name"`
	FullPath              string `json:"full_path"`
	FileTemplateProjectID int    `json:"file_template_project_id"`
	ParentID              int    `json:"parent_id"`
}

Group basic GitLab group struct

type Project

type Project struct {
	ID                   int        `json:"id"`
	Description          string     `json:"description"`
	DefaultBranch        string     `json:"default_branch"`
	TagList              []string   `json:"tag_list"`
	Archived             bool       `json:"archived"`
	Visibility           string     `json:"visibility"`
	SSHURLToRepo         string     `json:"ssh_url_to_repo"`
	HTTPURLToRepo        string     `json:"http_url_to_repo"`
	Web                  string     `json:"web_url"`
	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"`
	MergeRequestEnabled  bool       `json:"merge_request_enabled"`
	WikiEnabled          bool       `json:"wiki_enabled"`
	JobsEnabled          bool       `json:"jobs_enabled"`
	SnippetsEnabled      bool       `json:"snippets_enabled"`
	CreatedAt            *time.Time `json:"created_at"`
	LastActivityAt       *time.Time `jons:"last_activity_at"`
	SharedRunnersEnabled bool       `json:"shared_runners_enabled"`
	CreatorID            int        `json:"creator_id"`
	Namespace            struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Path string `json:"path"`
		Kind string `json:"kind"`
	} `json:"namespace"`
	Avatar           string `json:"avatar"`
	Star             int    `json:"star_count"`
	Fork             int    `json:"fork_count"`
	OpenIssues       int    `json:"open_issues"`
	PublicJobs       bool   `json:"public_jobs"`
	SharedWithGroups []struct {
		GroupID          int    `json:"group_id"`
		GroupName        string `json:"group_name"`
		GroupAccessLevel int    `json:"group_access_level"`
	} `json:"shared_with_groups"`
	RequestAccessEnabled bool `json:"request_access_enabled"`
}

Project basic GitLab project struct

Jump to

Keyboard shortcuts

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