config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserEmail    string = "user_email"
	AccessToken  string = "access_token"
	RefreshToken string = "refresh_token"
	Warehouse    string = "warehouse"
	Org          string = "org"
	Endpoint     string = "endpoint"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func Exists

func Exists(path string) bool

func GetAuthToken

func GetAuthToken() (string, string)

func GetEndpoint

func GetEndpoint() string

func GetOrg

func GetOrg() string

func GetUserEmail

func GetUserEmail() string

func GetWarehouse

func GetWarehouse() string

func RenewTokens

func RenewTokens(accessToken, refreshToken string) error

func SetUsingWarehouse

func SetUsingWarehouse(warehouse string) error

Types

type Config

type Config struct {
	UserEmail    string `ini:"user_email"`
	AccessToken  string `ini:"access_token"`
	RefreshToken string `ini:"refresh_token"`
	Warehouse    string `ini:"warehouse"`
	Org          string `ini:"org"`
	Endpoint     string `init:"endpoint"`
}

func Read

func Read() (*Config, error)

Read bendsql configuration files from the local file system and return a Config.

func (*Config) AuthToken

func (c *Config) AuthToken() (string, string)

func (*Config) Get

func (c *Config) Get(key string) (string, error)

Get a string value from a ConfigFile.

func (*Config) Set

func (c *Config) Set(key, value string) error

func (*Config) Write

func (c *Config) Write() error

type Configer

type Configer interface {
	AuthToken() (string, string)
	Get(string) (string, error)
	Set(string, string) error
}

func NewConfig

func NewConfig() (Configer, error)

Jump to

Keyboard shortcuts

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