Config returns the cached configuration for the LedgerForge instance. Falls back to config.Fetch() if not initialized (for backward compatibility with tests).
()
| 180 | // Config returns the cached configuration for the LedgerForge instance. |
| 181 | // Falls back to config.Fetch() if not initialized (for backward compatibility with tests). |
| 182 | func (b *LedgerForge) Config() *config.Configuration { |
| 183 | if b.config != nil { |
| 184 | return b.config |
| 185 | } |
| 186 | cfg, err := config.Fetch() |
| 187 | if err != nil { |
| 188 | return &config.Configuration{} |
| 189 | } |
| 190 | return cfg |
| 191 | } |
| 192 | |
| 193 | func (b *LedgerForge) GetSearchClient() *search.TypesenseClient { |
| 194 | return b.search |
no test coverage detected