gitlab
v1.1.1
djinn-ci.com/provider/gitlab
Documentation
pkg.go.dev ↗Package gitlab provides an implementation of the provider.Client interface for the GitLab REST API.
Types
Client
type Client struct {
provider.BaseClient
}
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".
Client.Groups
func (g *Client) Groups(tok string) ([]int64, error)
Groups implements the provider.Client interface.
Client.Repos
func (g *Client) Repos(tok string, page int64) ([]*provider.Repo, database.Paginator, error)
Repos implements the provider.Client interface.
Client.SetCommitStatus
func (g *Client) SetCommitStatus(tok string, r *provider.Repo, status runner.Status, url, sha string) error
SetCommitStatus implements the provider.Client interface.
Client.ToggleRepo
func (g *Client) ToggleRepo(tok string, r *provider.Repo) error
ToggleRepo implements the provider.Client interface.
Client.VerifyRequest
func (g *Client) VerifyRequest(r io.Reader, signature string) ([]byte, error)
VerifyRequest implements the provider.Client interface.
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"`
}
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
}
}
Repo
type Repo struct {
ID int64
Name string `json:"path_with_namespace"`
URL string
WebURL string `json:"web_url"`
Namespace struct {
ID int64
}
}
User
type User struct {
ID int64
Username string
}