Documentation ¶
Index ¶
Constants ¶
View Source
const KhronosConfigFileKey = "KHRONOS_CONFIG_FILE"
KhronosConfigFileKey is the env var key that will tell wich config file to take
Variables ¶
View Source
var ( // ValidStorageEngines contains the selectable storage engines ValidStorageEngines = []string{"dummy", "boltdb"} )
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { // Server configuration *config.Server // BoltDB configuration *BoltDB // Service configuration *Khronos // Json Configuration path ConfigFilePath string }
AppConfig holds the configuration of the application
func NewAppConfig ¶
NewAppConfig creates a new app configuration with all the settings loaded
func (*AppConfig) ConfigureApp ¶
func (a *AppConfig) ConfigureApp()
ConfigureApp loads all the application settings with a priority: First loads settings from file, then loads the settings from env vars.
type BoltDB ¶
type BoltDB struct { BoltDBPath string `envconfig:"BOLTDB_PATH" default:"data/khronos.db"` BoltDBTimeoutSeconds int `envconfig:"BOLTDB_TIMEOUT_SECONDS" default:"1"` }
BoltDB holds the configuration of storage
func (*BoltDB) LoadBoltDBConfig ¶
LoadBoltDBConfig loads boltdb env and jsonfile config
type Khronos ¶
type Khronos struct { // ResultBufferLen is default result channel length ResultBufferLen int `envconfig:"KHRONOS_RESULT_BUFFER_LEN"` // StorageEngine is the engine used to store the data StorageEngine string `envconfig:"KHRONOS_STORAGE_ENGINE"` //DontScheduleJobsStart flag, specifies to not schedule jobs at app startup DontScheduleJobsStart bool `envconfig:"KHRONOS_DONT_SCHEDULE_JOBS_ON_START"` //APIResourcesPerPage integer, specifies how many objects will the API return APIResourcesPerPage int `envconfig:"KHRONOS_API_RESOURCES_PER_PAGE"` //APIDisableSecurity Disable API security APIDisableSecurity bool `envconfig:"KHRONOS_API_DISABLE_SECURITY"` }
Khronos holds the configuration of the main application
func (*Khronos) LoadDefaults ¶
func (k *Khronos) LoadDefaults()
LoadDefaults loads defaults settings
func (*Khronos) LoadKhronosConfig ¶
LoadKhronosConfig Loads the configuration for the application
Click to show internal directories.
Click to hide internal directories.