config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileName = "config.yaml"
	TokenFileName  = "auth.json"
)

Variables

View Source
var (
	ConfigDirectory    = filepath.Join(xdg.ConfigHome, "bx")
	ConfigFileFullPath = filepath.Join(ConfigDirectory, ConfigFileName)
	TokenFileFullPath  = filepath.Join(ConfigDirectory, TokenFileName)
)

Functions

func Credentials

func Credentials() (string, string)

func CredentialsPresent

func CredentialsPresent() bool

func NewCachingTokenSource

func NewCachingTokenSource() (oauth2.TokenSource, error)

func ReadTokenFromFile

func ReadTokenFromFile() (*oauth2.Token, error)

Reads the token from the given json file

func SaveTokenToFile

func SaveTokenToFile(token *oauth2.Token) error

Saves the token as json into the token file

func SetCredentials

func SetCredentials(clientID, clientSecret string)

func WriteToFile

func WriteToFile() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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