config

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 12 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// by parameter
	Email      string
	PrivateKey string

	// by file
	Filename string

	// by OAuth setting
	NoOAuthClient     bool // for multiple config and avoid to use environment value.
	OAuthClientID     string
	OAuthClientSecret string
	OAuthRefreshToken string
	OAuthRedirectURL  string
	OAuthCode         string
	OAuthTokenFile    string
	OAuthCredsFile    string

	Scopes   []string
	TokenURL string
	Timeout  time.Duration

	CredsJSONBody    string
	UseTempCredsFile bool

	UseIAMRole   bool
	NoUseIAMRole bool // for multiple config and avoid to use environment value.
	// contains filtered or unexported fields
}

func (Config) Client

func (c Config) Client() (*http.Client, error)

func (*Config) CredsFilePath added in v0.5.0

func (c *Config) CredsFilePath() (string, error)

CredsFilePath returns credential file path. if UseTempCredsFile is true, then temporary creds json file will be created.

func (Config) DeleteTempCredsFile added in v0.5.0

func (c Config) DeleteTempCredsFile() error

DeleteTempCredsFile deletes temporary creds json file.

func (Config) GetOAuthCodeURL added in v0.7.0

func (c Config) GetOAuthCodeURL() string

GetOAuthCodeURL returns URL to get oauth code.

func (Config) JWTConfig

func (c Config) JWTConfig() (conf *jwt.Config, err error)

func (Config) NewContext

func (c Config) NewContext() context.Context

func (Config) NewOAuthClient added in v0.7.0

func (c Config) NewOAuthClient() (*http.Client, error)

NewOAuthClient creates http.Client from OAuth parameters.

func (Config) TokenSource added in v0.8.0

func (c Config) TokenSource(ctx context.Context) (oauth2.TokenSource, error)

Jump to

Keyboard shortcuts

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