console: implement "filter/saved" endpoints

This commit is contained in:
Vincent Bernat
2022-06-09 22:56:05 +02:00
parent b65d78ab1b
commit bf0c474726
22 changed files with 475 additions and 42 deletions

View File

@@ -11,6 +11,7 @@ import (
"akvorado/common/reporter"
"akvorado/console"
"akvorado/console/authentication"
"akvorado/console/database"
)
// ConsoleConfiguration represents the configuration file for the console command.
@@ -20,6 +21,7 @@ type ConsoleConfiguration struct {
Console console.Configuration
ClickHouse clickhousedb.Configuration
Auth authentication.Configuration
Database database.Configuration
}
// DefaultConsoleConfiguration is the default configuration for the console command.
@@ -30,6 +32,7 @@ func DefaultConsoleConfiguration() ConsoleConfiguration {
Console: console.DefaultConfiguration(),
ClickHouse: clickhousedb.DefaultConfiguration(),
Auth: authentication.DefaultConfiguration(),
Database: database.DefaultConfiguration(),
}
}
@@ -92,10 +95,16 @@ func consoleStart(r *reporter.Reporter, config ConsoleConfiguration, checkOnly b
if err != nil {
return fmt.Errorf("unable to initialize authentication component: %w", err)
}
databaseComponent, err := database.New(r, config.Database)
if err != nil {
return fmt.Errorf("unable to initialize database component: %w", err)
}
consoleComponent, err := console.New(r, config.Console, console.Dependencies{
Daemon: daemonComponent,
HTTP: httpComponent,
ClickHouseDB: clickhouseComponent,
Auth: authenticationComponent,
Database: databaseComponent,
})
if err != nil {
return fmt.Errorf("unable to initialize console component: %w", err)
@@ -115,6 +124,7 @@ func consoleStart(r *reporter.Reporter, config ConsoleConfiguration, checkOnly b
httpComponent,
clickhouseComponent,
authenticationComponent,
databaseComponent,
consoleComponent,
}
return StartStopComponents(r, daemonComponent, components)