factory

package
v41.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllDetected added in v41.0.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 added in v41.0.3

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/v41/github.Client with environment variable resolution

Types

type Config

type Config struct {
	Token               string
	Endpoint            string
	Owner               string
	Repo                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 Owner added in v41.0.12

func Owner(owner string) Option

func OwnerRepo added in v41.0.12

func OwnerRepo(ownerrepo string) Option

func SkipAuth added in v41.0.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