config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 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 (
	TARGET_COMMUNITY = "community"
	TARGET_CLOUD     = "cloud"
)

Variables

This section is empty.

Functions

func WriteConfig added in v0.1.0

func WriteConfig(cfg *Config) error

Types

type CloudConfig added in v0.1.0

type CloudConfig struct {
	Org       string `toml:"org"`
	Tenant    string `toml:"tenant"`
	Warehouse string `toml:"warehouse"`
	Gateway   string `toml:"gateway"`
	Endpoint  string `toml:"endpoint"`

	Token *Token `toml:"token,omitempty"`
}

func (*CloudConfig) GetDSN added in v0.1.0

func (c *CloudConfig) GetDSN() (string, error)

type CommunityConfig added in v0.1.0

type CommunityConfig struct {
	Host     string `toml:"host"`
	Port     int    `toml:"port"`
	User     string `toml:"user"`
	Password string `toml:"password"`
	Database string `toml:"database"`
	SSL      bool   `toml:"ssl"`

	Options map[string]string `toml:"options"`
}

func (*CommunityConfig) GetDSN added in v0.1.0

func (c *CommunityConfig) GetDSN() (string, error)

type Config

type Config struct {
	Target    string           `toml:"target"`
	Cloud     *CloudConfig     `toml:"cloud,omitempty"`
	Community *CommunityConfig `toml:"community,omitempty"`
}

func GetConfig added in v0.1.0

func GetConfig() (*Config, error)

func (*Config) GetDSN added in v0.1.0

func (c *Config) GetDSN() (string, error)

type Token added in v0.1.0

type Token struct {
	AccessToken  string    `toml:"access_token"`
	RefreshToken string    `toml:"refresh_token"`
	ExpiresAt    time.Time `toml:"expires_at"`
}

Jump to

Keyboard shortcuts

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