Documentation ¶
Overview ¶
Package schema contains shared configuration definitions.
There must be no use of other DTOs in this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigInject ¶
ConfigInject injects configuration into service.
Types ¶
type APIConfiguration ¶
type APIConfiguration struct { Host string `yaml:"host"` Port int `yaml:"port"` StaticPath string `yaml:"staticPath"` }
APIConfiguration - API-related configuration.
type Configuration ¶
type Configuration struct { API APIConfiguration `yaml:"api"` DB DatabaseConfiguration `yaml:"db"` PrivateKeyPath string `yaml:"privateKeyPath"` Debug bool `yaml:"debug"` // contains filtered or unexported fields }
Configuration - overall system configuration.
func (Configuration) GetPrivateKey ¶
func (s Configuration) GetPrivateKey() (ed25519.PrivateKey, error)
GetPrivateKey returns private key value from the loaded configuration.
type DatabaseConfiguration ¶
type DatabaseConfiguration struct { Host string `yaml:"host"` Port int `yaml:"port"` DatabaseName string `yaml:"databaseName"` Username string `yaml:"username"` Password string `yaml:"password" env:"POSTGRES_PASSWORD"` MigrationsDir string `yaml:"migrationsDir"` }
DatabaseConfiguration - DB-related configuration.
Note that for fields with `env` tag, environment variable value has priority over yaml value.
type RequiresConfig ¶
type RequiresConfig interface { // UseConfig attaches configuration to the service. UseConfig(*Configuration) }
RequiresConfig can use configuration.
type WithConfig ¶
type WithConfig interface { // Config returns used configuration. Config() *Configuration }
WithConfig can return configuration.
Click to show internal directories.
Click to hide internal directories.