config

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

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"`
	Database  string `toml:"database"`

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

func (*CloudConfig) GetDSN added in v0.1.0

func (c *CloudConfig) GetDSN(opts RuntimeOptions) (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(opts RuntimeOptions) (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(opts RuntimeOptions) (string, error)

type RuntimeOptions added in v0.3.0

type RuntimeOptions struct {
	Username string
	Password string
	Database string
}

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