// Copyright 2017 The go-github AUTHORS. All rights reserved.//// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package githubimport ()// ProjectListOptions specifies the optional parameters to the// OrganizationsService.ListProjects and RepositoriesService.ListProjects methods.typeProjectListOptionsstruct {// Indicates the state of the projects to return. Can be either open, closed, or all. Default: open State string`url:"state,omitempty"`ListOptions}// ListProjects lists the projects for a repo.//// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects////meta:operation GET /repos/{owner}/{repo}/projectsfunc ( *RepositoriesService) ( context.Context, , string, *ProjectListOptions) ([]*Project, *Response, error) { := fmt.Sprintf("repos/%v/%v/projects", , ) , := addOptions(, )if != nil {returnnil, nil, } , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, }// TODO: remove custom Accept headers when APIs fully launch. .Header.Set("Accept", mediaTypeProjectsPreview)var []*Project , := .client.Do(, , &)if != nil {returnnil, , }return , , nil}// CreateProject creates a GitHub Project for the specified repository.//// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project////meta:operation POST /repos/{owner}/{repo}/projectsfunc ( *RepositoriesService) ( context.Context, , string, *ProjectOptions) (*Project, *Response, error) { := fmt.Sprintf("repos/%v/%v/projects", , ) , := .client.NewRequest("POST", , )if != nil {returnnil, nil, }// TODO: remove custom Accept headers when APIs fully launch. .Header.Set("Accept", mediaTypeProjectsPreview) := &Project{} , := .client.Do(, , )if != nil {returnnil, , }return , , nil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.