|
@@ -2,7 +2,6 @@ package database
|
|
|
|
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
- "git.beejay.kim/Craft/Api/config"
|
|
|
|
"github.com/ClickHouse/clickhouse-go/v2"
|
|
"github.com/ClickHouse/clickhouse-go/v2"
|
|
"strings"
|
|
"strings"
|
|
)
|
|
)
|
|
@@ -12,7 +11,12 @@ type Config struct {
|
|
}
|
|
}
|
|
|
|
|
|
func (cfg Config) Invalidate() error {
|
|
func (cfg Config) Invalidate() error {
|
|
- return config.Invalidate(cfg)
|
|
|
|
|
|
+ var err error
|
|
|
|
+ if err = cfg.Clickhouse.Invalidate(); err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
|
|
|
|
type configCH struct {
|
|
type configCH struct {
|
|
@@ -49,7 +53,7 @@ func (c configCH) Invalidate() error {
|
|
return fmt.Errorf("`clickhouse.database` must not be an empty string")
|
|
return fmt.Errorf("`clickhouse.database` must not be an empty string")
|
|
}
|
|
}
|
|
|
|
|
|
- return config.Invalidate(c)
|
|
|
|
|
|
+ return c.Params.Invalidate()
|
|
}
|
|
}
|
|
|
|
|
|
func (p params) Invalidate() error {
|
|
func (p params) Invalidate() error {
|
|
@@ -73,7 +77,7 @@ func (p params) Invalidate() error {
|
|
return fmt.Errorf("`clickhouse.params.write-timeout` must not be at least 1")
|
|
return fmt.Errorf("`clickhouse.params.write-timeout` must not be at least 1")
|
|
}
|
|
}
|
|
|
|
|
|
- return config.Invalidate(p)
|
|
|
|
|
|
+ return nil
|
|
}
|
|
}
|
|
|
|
|
|
func (p params) CompressionMethod() clickhouse.CompressionMethod {
|
|
func (p params) CompressionMethod() clickhouse.CompressionMethod {
|