factory

package
v47.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenAndEndpoints

func GetTokenAndEndpoints() (string, string, string, string)

GetTokenAndEndpoints returns token and endpoints. The endpoints to be generated are URLs without a trailing slash.

func NewGithubClient

func NewGithubClient(opts ...Option) (*github.Client, error)

NewGithubClient returns github.com/google/go-github/v47/github.Client with environment variable resolution

Types

type Config

type Config struct {
	Token               string
	Endpoint            string
	DialTimeout         time.Duration
	TLSHandshakeTimeout time.Duration
	Timeout             time.Duration
	HTTPClient          *http.Client
	SkipAuth            bool
}

type Option

type Option func(*Config) error

func DialTimeout

func DialTimeout(to time.Duration) Option

func Endpoint

func Endpoint(t string) Option

func HTTPClient

func HTTPClient(httpClient *http.Client) Option

func SkipAuth added in v47.1.6

func SkipAuth(enable bool) Option

func TLSHandshakeTimeout

func TLSHandshakeTimeout(to time.Duration) Option

func Timeout

func Timeout(to time.Duration) Option

func Token

func Token(t string) Option

Jump to

Keyboard shortcuts

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