factory

package
v58.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: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllDetected

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/v58/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 v58.0.12

func Owner(owner string) Option

func OwnerRepo added in v58.0.12

func OwnerRepo(ownerrepo string) Option

func SkipAuth

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