config

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DefaultEnvironmentName  string                 `yaml:"default_environment"`
	SelectedEnvironmentName string                 `yaml:"-"`
	SelectedEnvironment     *Environment           `yaml:"-"`
	Environments            map[string]Environment `yaml:"environments"`
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile(fs afero.Fs, path string) (*Config, error)

func LoadOrCreate

func LoadOrCreate(fs afero.Fs, path string) (*Config, error)

func (*Config) GetSecretByKey

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

func (*Config) Persist

func (c *Config) Persist() error

func (*Config) PersistToFs

func (c *Config) PersistToFs(fs afero.Fs) error

func (*Config) SelectEnvironment

func (c *Config) SelectEnvironment(name string) error

type Connections

type Connections struct {
	GoogleCloudPlatform []GoogleCloudPlatformConnection `yaml:"google_cloud_platform"`
	Snowflake           []SnowflakeConnection           `yaml:"snowflake"`
	Postgres            []PostgresConnection            `yaml:"postgres"`
	RedShift            []PostgresConnection            `yaml:"redshift"`
	MsSQL               []MsSQLConnection               `yaml:"mssql"`
	Synapse             []MsSQLConnection               `yaml:"synapse"`
	Mongo               []MongoConnection               `yaml:"mongo"`
	MySQL               []MySQLConnection               `yaml:"mysql"`
	Notion              []NotionConnection              `yaml:"notion"`
	HANA                []HANAConnection                `yaml:"hana"`
	Generic             []GenericConnection             `yaml:"generic"`
	// contains filtered or unexported fields
}

type Environment

type Environment struct {
	Connections Connections `yaml:"connections"`
}

func (*Environment) GetSecretByKey

func (e *Environment) GetSecretByKey(key string) (string, error)

type GenericConnection

type GenericConnection struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

func (GenericConnection) MarshalJSON

func (c GenericConnection) MarshalJSON() ([]byte, error)

type GoogleCloudPlatformConnection

type GoogleCloudPlatformConnection struct {
	Name               string `yaml:"name"`
	ServiceAccountJSON string `yaml:"service_account_json"`
	ServiceAccountFile string `yaml:"service_account_file"`
	ProjectID          string `yaml:"project_id"`

	Location string `yaml:"location"`
	// contains filtered or unexported fields
}

func (*GoogleCloudPlatformConnection) GetCredentials

func (c *GoogleCloudPlatformConnection) GetCredentials() *google.Credentials

func (GoogleCloudPlatformConnection) MarshalJSON

func (c GoogleCloudPlatformConnection) MarshalJSON() ([]byte, error)

func (*GoogleCloudPlatformConnection) SetCredentials

func (c *GoogleCloudPlatformConnection) SetCredentials(cred *google.Credentials)

type HANAConnection added in v0.8.2

type HANAConnection struct {
	Name     string `yaml:"name" json:"name"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Host     string `yaml:"host"     json:"host"`
	Port     int    `yaml:"port"     json:"port"`
	Database string `yaml:"database" json:"database"`
}

type MongoConnection added in v0.7.2

type MongoConnection struct {
	Name     string `yaml:"name" json:"name"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Host     string `yaml:"host"     json:"host"`
	Port     int    `yaml:"port"     json:"port"`
	Database string `yaml:"database" json:"database"`
}

type MsSQLConnection added in v0.5.6

type MsSQLConnection struct {
	Name     string `yaml:"name" json:"name"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Host     string `yaml:"host"     json:"host"`
	Port     int    `yaml:"port"     json:"port"`
	Database string `yaml:"database" json:"database"`
}

type MySQLConnection added in v0.7.8

type MySQLConnection struct {
	Name     string `yaml:"name" json:"name"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Host     string `yaml:"host"     json:"host"`
	Port     int    `yaml:"port"     json:"port"`
	Database string `yaml:"database" json:"database"`
}

type NotionConnection added in v0.7.9

type NotionConnection struct {
	Name   string `yaml:"name" json:"name"`
	APIKey string `yaml:"api_key" json:"api_key"`
}

type PostgresConnection added in v0.5.0

type PostgresConnection struct {
	Name         string `yaml:"name" json:"name"`
	Username     string `yaml:"username" json:"username"`
	Password     string `yaml:"password" json:"password"`
	Host         string `yaml:"host" json:"host"`
	Port         int    `yaml:"port" json:"port"`
	Database     string `yaml:"database" json:"database"`
	Schema       string `yaml:"schema" json:"schema"`
	PoolMaxConns int    `yaml:"pool_max_conns" json:"pool_max_conns" default:"10"`
	SslMode      string `yaml:"ssl_mode" json:"ssl_mode" default:"disable"`
}

type SnowflakeConnection

type SnowflakeConnection struct {
	Name      string `yaml:"name"`
	Account   string `yaml:"account"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	Region    string `yaml:"region"`
	Role      string `yaml:"role"`
	Database  string `yaml:"database"`
	Schema    string `yaml:"schema"`
	Warehouse string `yaml:"warehouse"`
}

func (SnowflakeConnection) MarshalJSON

func (c SnowflakeConnection) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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