config

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const APIKeyEnv = "XATA_API_KEY"

env var to read the API key from

View Source
const ArgKey = "configdir"

ArgKey is the cmd argument used to configure the config dir path

View Source
const DirPerms = 0700
View Source
const FilePerms = 0600

Variables

This section is empty.

Functions

func APIKey

func APIKey(c *cli.Context) (string, error)

APIKey reads and returns the configured API key

func APIKeyInEnv

func APIKeyInEnv() bool

APIKeyInEnv returns true if API key is overridden by XATA_API_KEY env var

func ConfigDir

func ConfigDir(c *cli.Context) string

Config dir to use, with the following precedence:

1. --configdir arg 2. $XATA_CONFIG_DIR env var 2. $XDG_CONFIG_HOME/xata if $XDG_CONFIG_HOME is defined 3. %APP_DATA%/Xata CLI folder (windows only) 4. ~/.config/xata

func LoggedIn

func LoggedIn(c *cli.Context) (bool, error)

LoggedIn returns true if the cli is authenticated

func RemoveAPIKey

func RemoveAPIKey(c *cli.Context) error

func StoreAPIKey

func StoreAPIKey(c *cli.Context, key string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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