Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.12 KB

File metadata and controls

48 lines (34 loc) · 1.12 KB

drone-go

drone-go is a Go client library for accessing the Drone API.

Build Status GoDoc ![Gitter](https://badges.gitter.im/Join Chat.svg)

Download the package using go get:

go get "github.com/drone/drone-go/drone"

Import the package:

import "github.com/drone/drone-go/drone"

Create the client:

token := "my-user-token"
url := "https://my-drone-url.com"
client := drone.NewClient(token, url)

Get the current user:

user, err := client.Users.GetCurrent()
fmt.Println(user)

Get the repository list:

repos, err := client.Repos.List()
fmt.Println(repos)

Get the named repository:

repo, err := client.Repos.Get("github.com", "drone", "drone-go")
fmt.Println(repo)