conf

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug                   bool
	Production              bool
	DBConfigurationFile     string
	AgnuDBConfigurationFile string
	DBConfiguration         *DBConfiguration
	AgnuDBConfiguration     *DBConfiguration
	JwtSecret               string
	// contains filtered or unexported fields
}

Config for the environment, read from a json file

func NewInitialConfig

func NewInitialConfig(fileName string) (Config, error)

NewInitialConfig reads configuration from json file and validates it

func (*Config) Validate

func (cfg *Config) Validate() error

type ConfigBase

type ConfigBase struct{}

func (*ConfigBase) ReadConfigurationFile

func (cfg *ConfigBase) ReadConfigurationFile(fileName string) ([]byte, error)

type DBConfiguration

type DBConfiguration struct {
	DBName   string `json:"dbname,omitempty"`
	Engine   string `json:"engine,omitempty"`
	Host     string `json:"host,omitempty"`
	Port     int    `json:"port,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

func (*DBConfiguration) GetDSN

func (cfg *DBConfiguration) GetDSN() (string, error)

func (*DBConfiguration) Validate

func (cfg *DBConfiguration) Validate() error

Jump to

Keyboard shortcuts

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