mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console: implement "filter/saved" endpoints
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user