1
0
mirror of https://github.com/drone/drone-cli.git synced 2026-01-19 17:31:35 +01:00
drone-cli/vendor/github.com/drone/drone-go
jackspirou 67e0ed9b4f use the drone.NewClientTokenTLS method and vendor by hand
updating github.com/drone/drone-go vendored dep

vendor by hand

update vendored drone-go

fixing syscerts

fixing windows 509x package errors

use TLS CA roots with windows later
2016-03-14 23:54:50 -05:00
..
drone use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00
plugin use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00
template use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00
.drone.yml use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00
.gitignore use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00
LICENSE use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00
README.md use the drone.NewClientTokenTLS method and vendor by hand 2016-03-14 23:54:50 -05:00

drone-go

Build Status

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

Download the package using go get:

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

Import the package:

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

Create the client:

const (
	token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
	host  = "http://drone.company.com"
)

client := drone.NewClientToken(host, token)

Get the current user:

user, err := client.Self()
fmt.Println(user)

Get the repository list:

repos, err := client.RepoList()
fmt.Println(repos)

Get the named repository:

repo, err := client.Repo("drone", "drone-go")
fmt.Println(repo)