gitlab

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package gitlab provides an implementation of the provider.Client interface for the GitLab REST API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	provider.BaseClient
}

func New

func New(host, endpoint, secret, clientId, clientSecret string) *Client

New returns a new Client to the GitLab REST API. If the given endpoint is empty then the default "https://gitlab.com/api/v4" will be used. This will set the following scopes to request: "api".

func (*Client) Groups

func (g *Client) Groups(tok string) ([]int64, error)

Groups implements the provider.Client interface.

func (*Client) Repos

func (g *Client) Repos(tok string, page int64) ([]*provider.Repo, database.Paginator, error)

Repos implements the provider.Client interface.

func (*Client) SetCommitStatus

func (g *Client) SetCommitStatus(tok string, r *provider.Repo, status runner.Status, url, sha string) error

SetCommitStatus implements the provider.Client interface.

func (*Client) ToggleRepo

func (g *Client) ToggleRepo(tok string, r *provider.Repo) error

ToggleRepo implements the provider.Client interface.

func (*Client) VerifyRequest

func (g *Client) VerifyRequest(r io.Reader, signature string) ([]byte, error)

VerifyRequest implements the provider.Client interface.

type MergeRequestEvent

type MergeRequestEvent struct {
	User    User
	Project Repo
	Attrs   struct {
		ID              int64  `json:"iid"`
		TargetBranch    string `json:"target_branch"`
		SourceProjectID int64  `json:"source_project_id"`
		TargetProjectID int64  `json:"target_project_id"`
		AuthorID        int64  `json:"author_id"`
		Title           string
		Source          struct {
			WebURL string `json:"web_url"`
		}
		LastCommit struct {
			ID string
		} `json:"last_commit"`
		URL    string
		Action string
	} `json:"object_attributes"`
}

type PushEvent

type PushEvent struct {
	After   string
	Ref     string
	UserID  int64 `json:"user_id"`
	Project Repo
	Commits []struct {
		ID      string
		Message string
		URL     string
		Author  map[string]string
	}
}

type Repo

type Repo struct {
	ID        int64
	Name      string `json:"path_with_namespace"`
	URL       string
	WebURL    string `json:"web_url"`
	Namespace struct {
		ID int64
	}
}

type User

type User struct {
	ID       int64
	Username string
}

Jump to

Keyboard shortcuts

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