configs

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TEAL_VERSION = "v0.0.3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectPath string
	Version     string                `yaml:"version"`
	Module      string                `yaml:"module"`
	Connections []*DBConnectionConfig `yaml:"connections"`
	Cores       int                   `yaml:"cores"`
}

type ConfigService

type ConfigService struct {
}

func InitConfigService

func InitConfigService() *ConfigService

func (*ConfigService) GetConfig

func (configService *ConfigService) GetConfig(configFileName string, projectPath string) (*Config, error)

func (*ConfigService) GetProfile

func (configService *ConfigService) GetProfile(projectPath string) (*Profile, error)

type DBConnectionConfig

type DBConnectionConfig struct {
	Name   string `yaml:"name"`
	Type   string `yaml:"type"`
	Config struct {
		Host        string   `yaml:"host"`
		Port        int      `yaml:"port"`
		Database    string   `yaml:"database"`
		User        string   `yaml:"user"`
		Password    int      `yaml:"password"`
		Path        string   `yaml:"path"`
		Extensions  []string `yaml:"extensions"`
		ExtraParams []struct {
			Name  string `yaml:"name"`
			Value string `yaml:"value"`
		} `yaml:"extraParams"`
	} `yaml:"config"`
}

type MatType

type MatType string
const (
	MAT_TABLE       MatType = "table"
	MAT_VIEW        MatType = "view"
	MAT_INCREMENTAL MatType = "incremental"
	// From DataFrame to DB
	MAT_UPSTREAM MatType = "upstream"
	// From DB to DataFrame
	MAT_DOWNSTREAM MatType = "downstream"
	MAT_CUSTOM     MatType = "custom"
)

type ModelProfile

type ModelProfile struct {
	Name            string  `yaml:"name"`
	Connection      string  `yaml:"connection"`
	Materialization MatType `yaml:"materialization"`
}

type Profile

type Profile struct {
	Version    string `yaml:"version"`
	Name       string `yaml:"name"`
	Connection string `yaml:"connection"`
	Models     struct {
		Stages []struct {
			Name   string `yaml:"name"`
			Models []ModelProfile
		} `yaml:"stages"`
	} `yaml:"models"`
	Sources []SourceProfile `yaml:"sources"`
}

func (Profile) GetModelProfile

func (p Profile) GetModelProfile(stage string, name string) ModelProfile

type SourceProfile

type SourceProfile struct {
	Name       string   `yaml:"name"`
	Connection string   `yaml:"connection"`
	Type       string   `yaml:"type"`
	ReadOnly   bool     `yaml:"readOnly"`
	Tables     []string `yaml:"tables"`
	Params     []struct {
		Name  string `yaml:"name"`
		Value string `yaml:"value"`
	} `yaml:"params"`
}

Jump to

Keyboard shortcuts

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