Skip to content

curx/drone-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Go client for the Drone API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%