env

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: GPL-3.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DdlDefDecLength = 20
	DdlMinDecLength = 24
	DdlMaxDecScale  = 24
	DdlMaxDecLength = 38
	DdlMinDecScale  = 6
)

Variables

View Source
var (
	HomeDir        = os.Getenv("SLING_HOME_DIR")
	HomeDirEnvFile = ""
	Env            = &EnvFile{}
	PlausibleURL   = ""
	SentryDsn      = ""
	NoColor        = g.In(os.Getenv("SLING_LOGGING"), "NO_COLOR", "JSON")
	LogSink        func(*g.LogLine)
	TelMap         = g.M("begin_time", time.Now().UnixMicro())
	TelMux         = sync.Mutex{}
	HomeDirs       = map[string]string{}

	NoDebugKey = " /* nD */"
	Executable = ""
)

Functions

func BlueString added in v1.1.8

func BlueString(text string) string

func Clean added in v1.2.16

func Clean(props map[string]string, line string) string

Clean removes creds from a log line

func CleanTableName added in v1.2.22

func CleanTableName(tableName string) string

func CleanWindowsPath added in v1.2.19

func CleanWindowsPath(path string) string

func CyanString added in v1.1.15

func CyanString(text string) string

func DarkGrayString added in v1.1.15

func DarkGrayString(text string) string

func GetEnvFilePath added in v1.2.4

func GetEnvFilePath(dir string) string

func GetHomeDirConnsMap added in v1.2.4

func GetHomeDirConnsMap() (connsMap map[string]map[string]any, err error)

func GetTempFolder added in v1.2.4

func GetTempFolder() string

func GreenString added in v1.1.8

func GreenString(text string) string

func HomeBinDir added in v1.2.4

func HomeBinDir() string

func InitLogger

func InitLogger()

InitLogger initializes the g Logger

func LogSQL added in v1.2.16

func LogSQL(props map[string]string, query string, args ...any)

func MagentaString added in v1.2.2

func MagentaString(text string) string

func Print added in v1.1.6

func Print(text string)

func Println added in v1.1.6

func Println(text string)

func RedString added in v1.1.8

func RedString(text string) string

func RemoveAllLocalTempFile added in v1.2.16

func RemoveAllLocalTempFile(localPath string)

RemoveAllLocalTempFile deletes the local folder

func RemoveLocalTempFile added in v1.2.16

func RemoveLocalTempFile(localPath string)

RemoveLocalTempFile deletes the local file

func SetHomeDir added in v1.2.4

func SetHomeDir(name string) string

func SetLogger added in v1.1.6

func SetLogger()

func SetTelVal added in v1.2.2

func SetTelVal(key string, value any)

func Vars added in v1.2.4

func Vars() (vars map[string]string)

Vars are the variables we are using

func WriteTempSQL added in v1.2.16

func WriteTempSQL(sql string, filePrefix ...string) (sqlPath string, err error)

Types

type EnvFile added in v0.86.56

type EnvFile struct {
	Connections map[string]map[string]interface{} `json:"connections,omitempty" yaml:"connections,omitempty"`
	Variables   map[string]interface{}            `json:"variables,omitempty" yaml:"variables,omitempty"`

	Path       string `json:"-" yaml:"-"`
	TopComment string `json:"-" yaml:"-"`
	Body       string `json:"-" yaml:"-"`
}

func LoadEnvFile added in v0.86.56

func LoadEnvFile(path string) (ef EnvFile)

func LoadSlingEnvFile added in v0.86.56

func LoadSlingEnvFile() (ef EnvFile)

func LoadSlingEnvFileBody added in v1.2.15

func LoadSlingEnvFileBody(body string) (ef EnvFile, err error)

func (*EnvFile) WriteEnvFile added in v1.2.4

func (ef *EnvFile) WriteEnvFile() (err error)

Jump to

Keyboard shortcuts

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