Documentation ¶
Index ¶
- func CreateConfigFile() safego.Option[error]
- func CreateDir(dir string) safego.Option[error]
- func CreateFile(path string) safego.Option[error]
- func DoesConfigFileExists() (bool, safego.Option[error])
- func ExtractExpressions(str string, expr string) []string
- func GetConfigData() (types.Config, safego.Option[error])
- func GetConfigFilePathBasedOnOS() (string, safego.Option[error])
- func GetDataDirBasedOnOS() (string, safego.Option[error])
- func GetTimestamp() int64
- func JsonifyQueryData(rows *sql.Rows) []string
- func Log(str ...string)
- func ParseHandleBars(template string, data map[string]any) (string, safego.Option[error])
- func ParseRequestBody(ctx *fiber.Ctx, body any)
- func PromptForDbConfig(dbConfig *types.DbConfig) safego.Option[error]
- func ReadJSONFile(filePath string, valRef any) safego.Option[error]
- func WriteFile(path string, data []byte) safego.Option[error]
- func WriteToJSONFile(filePath string, content any) safego.Option[error]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfigFile ¶
CreateConfigFile creates the config file.
func DoesConfigFileExists ¶
DoesConfigFileExists checks if the config file exists. It returns true if the file exists, false otherwise.
func ExtractExpressions ¶
ExtractExpressions extracts expressions from a string.
func GetConfigData ¶
GetConfigData extracts the database connection string from the config file.
func GetConfigFilePathBasedOnOS ¶
GetConfigFilePathBasedOnOS returns the config file path based on the OS.
func GetTimestamp ¶
func GetTimestamp() int64
GetTimestamp returns the current timestamp in nanoseconds.
func JsonifyQueryData ¶
JsonifyQueryData converts the data from a sql query to json.
func ParseHandleBars ¶
ParseHandleBars parses a handlebars template with the given template string and data.
func ParseRequestBody ¶
func ParseRequestBody(ctx *fiber.Ctx, body any)
ParseRequestBody parses the body of a request.
func PromptForDbConfig ¶
PromptForDbConfig prompts the user for their database configuration. It returns a DbConfig and an error.
func ReadJSONFile ¶
ReadJSONFile reads a JSON file and unmarshals it into a value reference.
Types ¶
This section is empty.