settings

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConfigFileName is the name of the config files (home / project)
	ConfigFileName = "airflow_settings"
	// ConfigFileType is the config file extension
	ConfigFileType = "yaml"
	// ConfigFileNameWithExt is the config filename with extension
	ConfigFileNameWithExt = fmt.Sprintf("%s.%s", ConfigFileName, ConfigFileType)
	// HomePath is the path to a users home directory
	HomePath, _ = fileutil.GetHomeDir()
	// HomeConfigFile is the global config file
	HomeConfigFile = filepath.Join(HomePath, ConfigFileNameWithExt)
	// WorkingPath is the path to the working directory
	WorkingPath, _ = fileutil.GetWorkingDir()
)

Functions

func AddConnections

func AddConnections(id string)

AddConnections is a function to add Connections from settings.yaml

func AddPools

func AddPools(id string)

AddPools is a function to add Pools from settings.yaml

func AddVariables

func AddVariables(id string)

AddVariables is a function to add Variables from settings.yaml

func ConfigSettings

func ConfigSettings(id string)

ConfigSettings is the main builder of the settings package

func InitSettings

func InitSettings()

InitSettings initializes settings file

Types

type Airflow

type Airflow struct {
	Connections `mapstructure:"connections"`
	Pools       `mapstructure:"pools"`
	Variables   `mapstructure:"variables"`
}

Airflow contains structure of airflow settings

type Config

type Config struct {
	Airflow `mapstructure:"airflow"`
}

Config is input data to generate connections, pools, and variables

type Connections

type Connections []struct {
	ConnID       string `mapstructure:"conn_id"`
	ConnType     string `mapstructure:"conn_type"`
	ConnHost     string `mapstructure:"conn_host"`
	ConnSchema   string `mapstructure:"conn_schema"`
	ConnLogin    string `mapstructure:"conn_login"`
	ConnPassword string `mapstructure:"conn_password"`
	ConnPort     int    `mapstructure:"conn_port"`
	ConnURI      string `mapstructure:"conn_uri"`
	ConnExtra    string `mapstructure:"conn_extra"`
}

Connections contains structure of airflow connections

type Pools

type Pools []struct {
	PoolName        string `mapstructure:"pool_name"`
	PoolSlot        int    `mapstructure:"pool_slot"`
	PoolDescription string `mapstructure:"pool_description"`
}

Pools contains structure of airflow pools

type Variables

type Variables []struct {
	VariableName  string `mapstructure:"variable_name"`
	VariableValue string `mapstructure:"variable_value"`
}

Variables contains structure of airflow variables

Jump to

Keyboard shortcuts

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