credentials

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvFormat        = "env"
	JSONFormat       = "json"
	PropertiesFormat = "properties"
)

Variables

This section is empty.

Functions

func ChooseFileLocation

func ChooseFileLocation(outputFormat string, filePath string, overwrite bool) (string, bool, error)

ChooseFileLocation starts an interactive prompt to get the path to the credentials file a while loop will be entered as it can take multiple attempts to find a suitable location if the file already exists

func GetDefaultPath

func GetDefaultPath(outputFormat string) (filePath string)

GetDefaultPath returns the default absolute path for the credentials file

func Write

func Write(output string, filepath string, credentials *Credentials) error

Write saves the credentials to a file in the specified output format

Types

type Credentials

type Credentials struct {
	ClientID     string `json:"client_id,omitempty"`
	ClientSecret string `json:"client_secret,omitempty"`
	TokenURL     string `json:"oauth_token_url,omitempty"`
}

Credentials is a type which represents the credentials for a service account

Jump to

Keyboard shortcuts

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