github

package module
v0.0.0-...-7dda9b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 11 Imported by: 0

README

copilot-go/github

copilot-go/github is a companion Go library for use with copilot-go. It provides a set of utilities for working with the GitHub API.

Go Reference

Installing

copilot-go is compatible with modern Go releases in module mode, with Go installed:

go get github.com/colbylwilliams/copilot-go/github

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "github.com/colbylwilliams/copilot-go/github"

and run go get without parameters.

Finally, to use the top-of-trunk version of this repo, use the following command:

go get github.com/colbylwilliams/copilot-go/github@main

Usage

See the /_examples/github directory for a complete and runnable example.

Documentation

Overview

Package copilot-go/github is a companion Go library for use with [copilot-go].

It provides a set of utilities for working with the GitHub API.

[copilot-go](https://pkg.go.dev/github.com/colbylwilliams/copilot-go)

Index

Constants

View Source
const (
	// AppTokenExpiration is the default expiration time for the GitHub App token.
	AppTokenExpiration = 10 * time.Minute // 10 minutes (maximum allowed by GitHub)

)

Variables

This section is empty.

Functions

func NewAppClient

func NewAppClient(ctx context.Context, cfg *copilot.Config) (*gh.Client, error)

func NewApplicationTokenSource

func NewApplicationTokenSource(clientID string, privateKey []byte) (oauth2.TokenSource, error)

NewApplicationTokenSource creates a new GitHub App token source using the provided client ID and private key.

func NewClient

func NewClient(ctx context.Context) (*gh.Client, error)

Types

type ReferenceResource

type ReferenceResource interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL