Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
johanix committed May 22, 2024
1 parent 690d015 commit 2fe4c2a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 7 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Johan Stenstam, [email protected]
* Johan Stenstam, [email protected]
*/

package main
Expand All @@ -10,6 +10,8 @@ import (

"github.com/go-playground/validator/v10"
"github.com/spf13/viper"

"github.com/dnstapir/tapir"
)

type Config struct {
Expand Down Expand Up @@ -156,3 +158,7 @@ func ValidateBySection(config *Config, configsections map[string]interface{}, cf
}
return nil
}

func (td *TemData) ProcessTapirGlobalConfig(tpkg tapir.TapirMsg) {
log.Printf("TapirProcessGlobalConfig: %+v", tpkg)
}
18 changes: 14 additions & 4 deletions refreshengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,20 @@ func (td *TemData) RefreshEngine(conf *Config, stopch chan struct{}) {
for {
select {
case tpkg = <-TapirIntelCh:
log.Printf("RefreshEngine: Tapir IntelUpdate: (src: %s) %d additions and %d removals\n",
tpkg.Data.SrcName, len(tpkg.Data.Added), len(tpkg.Data.Removed))
td.ProcessTapirUpdate(tpkg)
log.Printf("RefreshEngine: Tapir IntelUpdate evaluated.")
switch tpkg.Data.MsgType {
case "intelupdate":
log.Printf("RefreshEngine: Tapir IntelUpdate: (src: %s) %d additions and %d removals\n",
tpkg.Data.SrcName, len(tpkg.Data.Added), len(tpkg.Data.Removed))
td.ProcessTapirUpdate(tpkg)
log.Printf("RefreshEngine: Tapir IntelUpdate evaluated.")

case "global-config":
td.ProcessTapirGlobalConfig(tpkg.Data)
log.Printf("RefreshEngine: Tapir Global Config evaluated.")

default:
log.Printf("RefreshEngine: Tapir IntelUpdate: unknown msg type: %s", tpkg.Data.MsgType)
}

case zr = <-zonerefch:
zone = zr.Name
Expand Down
1 change: 1 addition & 0 deletions sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ func (td *TemData) ParseLocalFile(sourceid string, s *tapir.WBGlist, rpt chan st
func (td *TemData) BootstrapMqttSource(s *tapir.WBGlist, src SourceConf) (*tapir.WBGlist, error) {
// Initialize the API client
api := &tapir.ApiClient{
BaseUrl: fmt.Sprintf(src.BootstrapUrl, src.Bootstrap[0]), // Must specify a valid BaseUrl
ApiKey: src.BootstrapKey,
AuthMethod: "X-API-Key",
}
Expand Down

0 comments on commit 2fe4c2a

Please sign in to comment.