github

package
v0.7.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package github provides methods for creating a Github client for the purposes of interacting with the API. Provides support for retrieving authentication tokens from the following sources:

- Environment variables ($GITHUB_TOKEN) - Github CLI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (*github.Client, error)

New returns a new github.Client using credentials from one of the configured credential providers. If no token is found, an unauthenticated client is returned.

func Token

func Token() (string, error)

Token returns a valid token from one of the configured credential providers. If no token is found, ErrNoToken is returned.

Types

type ErrNoToken

type ErrNoToken struct {
	// contains filtered or unexported fields
}

ErrNoToken is returned when no token is found in the configured credential providers.

func (ErrNoToken) Error

func (e ErrNoToken) Error() string

Error returns the error message for ErrNoToken.

func (ErrNoToken) Unwrap

func (e ErrNoToken) Unwrap() []error

Unwrap returns the errors that caused the ErrNoToken error.

Jump to

Keyboard shortcuts

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