drone-go

Go client for the Drone API

  • Owner: drone/drone-go
  • Platform:
  • License:: Apache License 2.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

drone-go

import (
	"github.com/drone/drone-go/drone"
	"golang.org/x/oauth2"
)

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

func main() {
	// create an http client with oauth authentication.
	config := new(oauth2.Config)
	auther := config.Client(
		oauth2.NoContext,
		&oauth2.Token{
			AccessToken: token,
		},
	)

	// create the drone client with authenticator
	client := drone.NewClient(host, auther)

	// gets the current user
	user, err := client.Self()
	fmt.Println(user, err)

	// gets the named repository information
	repo, err := client.Repo("drone", "drone-go")
	fmt.Println(repo, err)
}

Main metrics

Overview
Name With Ownerdrone/drone-go
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:Apache License 2.0
所有者活动
Created At2015-02-12 18:58:17
Pushed At2024-07-08 16:10:16
Last Commit At2022-03-08 11:58:42
Release Count21
Last Release Namev1.7.1 (Posted on )
First Release Namev0.8.0 (Posted on )
用户参与
Stargazers Count280
Watchers Count13
Fork Count114
Commits Count218
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count54
Pull Requests Open Count2
Pull Requests Close Count15
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private