mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2024-12-01 10:38:59 +00:00
36 lines
748 B
Go
36 lines
748 B
Go
|
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
|
||
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||
|
|
||
|
// See page 110.
|
||
|
//!+
|
||
|
|
||
|
// Package github provides a Go API for the GitHub issue tracker.
|
||
|
// See https://developer.github.com/v3/search/#search-issues.
|
||
|
package github
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
const IssuesURL = "https://api.github.com/search/issues"
|
||
|
|
||
|
type IssuesSearchResult struct {
|
||
|
TotalCount int `json:"total_count"`
|
||
|
Items []*Issue
|
||
|
}
|
||
|
|
||
|
type Issue struct {
|
||
|
Number int
|
||
|
HTMLURL string `json:"html_url"`
|
||
|
Title string
|
||
|
State string
|
||
|
User *User
|
||
|
CreatedAt time.Time `json:"created_at"`
|
||
|
Body string // in Markdown format
|
||
|
}
|
||
|
|
||
|
type User struct {
|
||
|
Login string
|
||
|
HTMLURL string `json:"html_url"`
|
||
|
}
|
||
|
|
||
|
//!-
|