aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/xanzy/go-gitlab/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/README.md')
-rw-r--r--vendor/github.com/xanzy/go-gitlab/README.md27
1 files changed, 22 insertions, 5 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/README.md b/vendor/github.com/xanzy/go-gitlab/README.md
index 48fb4882b4..0b1f5bfc2a 100644
--- a/vendor/github.com/xanzy/go-gitlab/README.md
+++ b/vendor/github.com/xanzy/go-gitlab/README.md
@@ -20,6 +20,7 @@ incompatible changes that were needed to fully support the V4 Gitlab API.
This API client package covers most of the existing Gitlab API calls and is updated regularly
to add new and/or missing endpoints. Currently the following services are supported:
+- [x] Applications
- [x] Award Emojis
- [x] Branches
- [x] Broadcast Messages
@@ -96,8 +97,21 @@ access different parts of the GitLab API. For example, to list all
users:
```go
-git := gitlab.NewClient(nil, "yourtokengoeshere")
-//git.SetBaseURL("https://git.mydomain.com/api/v4")
+git, err := gitlab.NewClient("yourtokengoeshere")
+if err != nil {
+ log.Fatalf("Failed to create client: %v", err)
+}
+users, _, err := git.Users.ListUsers(&gitlab.ListUsersOptions{})
+```
+
+There are a few `With...` option functions that can be used to customize
+the API client. For example, to set a custom base URL:
+
+```go
+git, err := gitlab.NewClient("yourtokengoeshere", WithBaseURL("https://git.mydomain.com/api/v4"))
+if err != nil {
+ log.Fatalf("Failed to create client: %v", err)
+}
users, _, err := git.Users.ListUsers(&gitlab.ListUsersOptions{})
```
@@ -105,7 +119,7 @@ Some API methods have optional parameters that can be passed. For example,
to list all projects for user "svanharmelen":
```go
-git := gitlab.NewClient(nil)
+git := gitlab.NewClient("yourtokengoeshere")
opt := &ListProjectsOptions{Search: gitlab.String("svanharmelen")}
projects, _, err := git.Projects.ListProjects(opt)
```
@@ -125,7 +139,10 @@ import (
)
func main() {
- git := gitlab.NewClient(nil, "yourtokengoeshere")
+ git, err := gitlab.NewClient("yourtokengoeshere")
+ if err != nil {
+ log.Fatalf("Failed to create client: %v", err)
+ }
// Create new project
p := &gitlab.CreateProjectOptions{
@@ -166,7 +183,7 @@ For complete usage of go-gitlab, see the full [package docs](https://godoc.org/g
## Author
-Sander van Harmelen (<sander@xanzy.io>)
+Sander van Harmelen (<sander@vanharmelen.nl>)
## License