{"modulePath":"github.com/coding/drone","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitlab\n\n## Constants\n\n```go\nconst (\n\tStatusPending  = \"pending\"\n\tStatusRunning  = \"running\"\n\tStatusSuccess  = \"success\"\n\tStatusFailure  = \"failed\"\n\tStatusCanceled = \"canceled\"\n)\n```\n\n```go\nconst (\n\tDescPending  = \"this build is pending\"\n\tDescRunning  = \"this buils is running\"\n\tDescSuccess  = \"the build was successful\"\n\tDescFailure  = \"the build failed\"\n\tDescCanceled = \"the build canceled\"\n)\n```\n\n```go\nconst (\n\tDefaultScope = \"api\"\n)\n```\n\n## Functions\n\n```go\nfunc ExtractFromPath(str string) (string, string, error)\n```\n\n```go\nfunc GetKeyTitle(rawurl string) (string, error)\n```\nGetKeyTitle is a helper function that generates a title for the RSA public key based on the username and domain name.\n\n```go\nfunc GetProjectId(r *Gitlab, c *client.Client, owner, name string) (projectId string, err error)\n```\n\n```go\nfunc GetUserAvatar(email string) string\n```\n\n```go\nfunc GetUserEmail(c *client.Client, defaultURL string) (*client.Client, error)\n```\n\n```go\nfunc IsAdmin(proj *client.Project) bool\n```\nIsAdmin is a helper function that returns true if the user has Admin access to the repository.\n\n```go\nfunc IsRead(proj *client.Project) bool\n```\nIsRead is a helper function that returns true if the user has Read-only access to the repository.\n\n```go\nfunc IsWrite(proj *client.Project) bool\n```\nIsWrite is a helper function that returns true if the user has Read-Write access to the repository.\n\n```go\nfunc NewClient(url, accessToken string, skipVerify bool) *client.Client\n```\nNewClient is a helper function that returns a new GitHub client using the provided OAuth token.\n\n## Types\n\n```go\ntype Gitlab struct {\n\tURL          string\n\tClient       string\n\tSecret       string\n\tAllowedOrgs  []string\n\tCloneMode    string\n\tOpen         bool\n\tPrivateMode  bool\n\tSkipVerify   bool\n\tHideArchives bool\n\tSearch       bool\n}\n```\n\n```go\nfunc Load(config string) *Gitlab\n```\n\n```go\nfunc (g *Gitlab) Activate(user *model.User, repo *model.Repo, k *model.Key, link string) error\n```\nActivate activates a repository by adding a Post-commit hook and a Public Deploy key, if applicable.\n\n```go\nfunc (g *Gitlab) Auth(token, secret string) (string, error)\n```\n\n```go\nfunc (g *Gitlab) Deactivate(user *model.User, repo *model.Repo, link string) error\n```\nDeactivate removes a repository by removing all the post-commit hooks which are equal to link and removing the SSH deploy key.\n\n```go\nfunc (g *Gitlab) File(user *model.User, repo *model.Repo, build *model.Build, f string) ([]byte, error)\n```\nFile fetches a file from the remote repository and returns in string format.\n\n```go\nfunc (g *Gitlab) Hook(req *http.Request) (*model.Repo, *model.Build, error)\n```\nParseHook parses the post-commit hook from the Request body and returns the required data in a standard format.\n\n```go\nfunc (g *Gitlab) Login(res http.ResponseWriter, req *http.Request) (*model.User, bool, error)\n```\nLogin authenticates the session and returns the remote user details.\n\n```go\nfunc (g *Gitlab) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error)\n```\nNetrc returns a .netrc file that can be used to clone private repositories from a remote system.\n\n```go\nfunc (g *Gitlab) Oauth2Transport(r *http.Request) *oauth2.Transport\n```\n¯\\\\\\_(ツ)\\_/¯\n\n```go\nfunc (g *Gitlab) Perm(u *model.User, owner, name string) (*model.Perm, error)\n```\nPerm fetches the named repository from the remote system.\n\n```go\nfunc (g *Gitlab) Repo(u *model.User, owner, name string) (*model.Repo, error)\n```\nRepo fetches the named repository from the remote system.\n\n```go\nfunc (g *Gitlab) Repos(u *model.User) ([]*model.RepoLite, error)\n```\nRepos fetches a list of repos from the remote system.\n\n```go\nfunc (g *Gitlab) Status(u *model.User, repo *model.Repo, b *model.Build, link string) error\n```\nNOTE Currently gitlab doesn't support status for commits and events,\n\n\talso if we want get MR status in gitlab we need implement a special plugin for gitlab,\n\tgitlab uses API to fetch build status on client side. But for now we skip this.\n\n","path":"github.com/coding/drone/remote/gitlab","name":"gitlab","synopsis":"","isRedistributable":true}
