drone-go

Go client for the Drone API

  • 所有者: drone/drone-go
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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)
}

主要指標

概覽
名稱與所有者drone/drone-go
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證Apache License 2.0
所有者活动
創建於2015-02-12 18:58:17
推送於2024-07-08 16:10:16
最后一次提交2022-03-08 11:58:42
發布數21
最新版本名稱v1.7.1 (發布於 )
第一版名稱v0.8.0 (發布於 )
用户参与
星數275
關注者數13
派生數113
提交數218
已啟用問題?
問題數0
打開的問題數0
拉請求數54
打開的拉請求數2
關閉的拉請求數15
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?