github

package
v1.90.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Overview

Description: Implements consistent ways to get Auth across platforms.

Package github includes helper functions for standardized ways of interacting with Github across machines.

Description: This file contains the options for the github client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken() (cfg.SecretData, error)

GetToken returns a github access token from the machine

func NewClient

func NewClient(optFns ...Option) (*github.Client, error)

NewClient returns a new Github client using credentials from GetToken().

Types

type Option added in v1.40.0

type Option func(*Options)

Option is a functional option for configuring a client

func WithAllowUnauthenticated added in v1.40.0

func WithAllowUnauthenticated() Option

WithAllowUnauthenticated allows the client to be created without a token.

func WithLogger added in v1.40.0

func WithLogger(log logrus.FieldLogger) Option

WithLogger provides a logger for the client

type Options added in v1.40.0

type Options struct {
	// AllowUnauthenticated allows the client to be created without
	// a token.
	AllowUnauthenticated bool

	// Logger is an optional logger to use for logging
	Logger logrus.FieldLogger
}

Options contains the options for a Github client

Jump to

Keyboard shortcuts

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