• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

alcacoop/go-github-client: a package to integrate Github REST API in go applicat ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

alcacoop/go-github-client

开源软件地址:

https://github.com/alcacoop/go-github-client

开源编程语言:

Go 100.0%

开源软件介绍:

go-github-client: Github v3 API Client for Go

DEPRECATED

go-github-client is now superseded by google/go-github package released by Google.

Description

go-github-client is a Go package that aims to smoothly integrate Github Rest API in Go applications.

WARNING: This software is alpha quality so use it at your risks ;-)

We've extracted and refactored this package from cocode.io, our real-time web collaborative code editor integrated with GitHub Gist. The package is currently under active development because we're enhancing the integration between cocode.io and GitHub.

To keep you updated about future development, please feel free to watch this project on GitHub and to follow us on:

Of course, we're looking forward for your feedback & patches :)

Quickstart Examples

go get & go install

Download go-gothub-client and install go-github-client/client:

$ go get github.com/alcacoop/go-github-client/client

This command clone all the repository in "$GOPATH/src/github.com/alcacoop/go-github-client" and install "github.com/alcacoop/go-github-client/client" package in "$GOPATH/pkg/ARCH/github.com/alcacoop/go-github-client/client.a"

Now you can "go install" all the other subpackage (or just what you want):

$ go install github.com/alcacoop/go-github-client/users

$ go install github.com/alcacoop/go-github-client/gists

$ go install github.com/alcacoop/go-github-client/issues

go-github-client command line example applications

You can build and install some example applications using "go install":

$ go install github.com/alcacoop/go-github-client/examples/gh_get_userinfo

$ $GOPATH/bin/gh_get_userinfo
...

Create an authenticated GitHub API Client using Basic Authentication method

import (
  ghclient "github.com/alcacoop/go-github-client/client"
)

...

ghc, _ := ghclient.NewGitHubClient("testuser", "password", AUTH_USER_PASSWORD)

Get information about the authenticated user

import (
  ghusers "github.com/alcacoop/go-github-client/users"
)

usersc = ghusers.NewUsers(ghc)
res, err := usersc.GetUserInfo(*userinfo)
jr, err := res.Json()
name := jr.GetString("login")

Paginate public gists

import (
  ghgist "github.com/alcacoop/go-github-client/gists"
)

gistsc = ghgists.NewUsers(ghc)
res, err := gistsc.GetPublicGists()
jr, err := res.Json()

res2, err := res.NextPage()
jr2, err := res.Json()

More Info

API Reference

Examples




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap