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: 0

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