factory

package
v48.2.11 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllDetected added in v48.2.11

func GetAllDetected() (token, v3ep, v3upload, v4ep, host, hostSource, tokenSource string)

GetAllDetected returns token, endpoints, host and sources. The endpoints to be generated are URLs without a trailing slash.

func GetTokenAndEndpoints

func GetTokenAndEndpoints() (token string, v3ep string, v3upload string, v4ep 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/v48/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 v48.2.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