Initial working fully go release

This commit is contained in:
Martino Ferrari
2026-04-30 23:01:01 +02:00
parent 6e51ffc5e1
commit 90669c5fd6
22 changed files with 2950 additions and 196 deletions
+10
View File
@@ -21,6 +21,7 @@ type ServerConfig struct {
type DatasourceConfig struct {
Stub StubConfig `toml:"stub"`
EPICS EPICSConfig `toml:"epics"`
PVA PVAConfig `toml:"pva"`
Synthetic SyntheticConfig `toml:"synthetic"`
}
@@ -36,6 +37,11 @@ type EPICSConfig struct {
PVNames []string `toml:"pv_names"`
}
type PVAConfig struct {
Enabled bool `toml:"enabled"`
AddrList []string `toml:"addr_list"`
}
type SyntheticConfig struct {
Enabled bool `toml:"enabled"`
}
@@ -49,6 +55,7 @@ func Default() Config {
Datasource: DatasourceConfig{
Stub: StubConfig{Enabled: true},
EPICS: EPICSConfig{Enabled: true},
PVA: PVAConfig{Enabled: true},
Synthetic: SyntheticConfig{Enabled: true},
},
}
@@ -86,6 +93,9 @@ func applyEnv(cfg *Config) {
if v := env("UOPI_EPICS_CHANNEL_FINDER_URL"); v != "" {
cfg.Datasource.EPICS.ChannelFinderURL = v
}
if v := env("EPICS_PVA_ADDR_LIST"); v != "" {
cfg.Datasource.PVA.AddrList = strings.Fields(v)
}
}
func env(key string) string {