config

package
v0.0.0-...-26e77a4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides the configuration specification.

Index

Constants

View Source
const ConfigEnvVar = "SEMANTIC_SENSEI_CONFIG_PATH"

ConfigEnvVar is the environment variable that can be used to set the path to the configuration file.

View Source
const DefaultConfigPath = "/app/config.yaml"

DefaultConfigPath is the default path to the configuration file.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database Database `yaml:"database"`
}

Config represents the configuration settings for the application.

func New

func New() (*Config, error)

New creates a new instance of Config by reading the configuration file. It first checks if the config path environment variable is set, and if so, uses that as the path to the configuration file. If the environment variable is not set, it uses the default path. Then the config file is read, and unmarshalled. Returns a pointer to the Config struct and any error encountered during the process.

type Database

type Database struct {
	DB       string `yaml:"db"`
	Host     string `yaml:"host"`
	Password string `yaml:"password"`
	SSL      string `yaml:"ssl"`
	User     string `yaml:"user"`
}

Database represents the configuration for the database connection.

func (Database) ConnectionString

func (d Database) ConnectionString() string

ConnectionString returns the connection string for the database.

Jump to

Keyboard shortcuts

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