configs

package
v0.0.0-...-1d9f83f Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB() *gorm.DB

ConnectDB function is used to get or open the DB connection instance for any operations on the database.

func MustLoadEnvs

func MustLoadEnvs()

GetEnvs function is used to get the environment variables. this function used godotenv library to load and use the environment variable stored in .env file there are other libraries like viper or cobra that can be used, but for simplicity we use godotenv

Types

type AKeyless_secrets

type AKeyless_secrets struct {
	AkeylessUsername string `yaml:"username"`
	AkeylessPassword string `yaml:"password"`
}

type CM_secrets

type CM_secrets struct {
	Base_Url       string `yaml:"base_url"`
	Version        string `yaml:"version"`
	Cm_user        string `yaml:"cm_user"`
	Cm_password    string `yaml:"cm_password"`
	Encryption_key string `yaml:"encryption_key"`
}

type Config

type Config struct {
	Env              string `yaml:"env"`
	CM_secrets       `yaml:"cm_secret"`
	AKeyless_secrets `yaml:"akeyless_secret"`
}

func MustLoad

func MustLoad() *Config

MustLoad function reads the file, loads the data and store the fields in the Config struct

Jump to

Keyboard shortcuts

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