Documentation
¶
Overview ¶
Package types contains shared data structures and constants used across the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfigPath = "configs/default.yaml"
var Version = "dev"
Functions ¶
This section is empty.
Types ¶
type BenchmarkConfig ¶
type BenchmarkConfig struct {
Executor string `mapstructure:"executor"`
QPS int `mapstructure:"qps"`
Concurrency int `mapstructure:"concurrency"`
SlowThreshold time.Duration `mapstructure:"slow_threshold"`
}
BenchmarkConfig holds the benchmark configuration.
type BenchmarkStatus ¶
type BenchmarkStatus int
const ( StatusPending BenchmarkStatus = iota StatusRunning StatusCompleted StatusFailed StatusCancelled )
func (BenchmarkStatus) String ¶
func (b BenchmarkStatus) String() string
type Config ¶
type Config struct {
Log LogConfig `mapstructure:"log"`
Database DatabaseConfig `mapstructure:"database"`
Benchmark BenchmarkConfig `mapstructure:"benchmark"`
}
Config holds the application's configuration.
type DatabaseConfig ¶
type DatabaseConfig struct {
Driver string `mapstructure:"driver"`
DSN string `mapstructure:"dsn"`
}
DatabaseConfig holds the database configuration.
type DatabaseType ¶
type DatabaseType int
const ( DatabaseNone DatabaseType = iota DatabaseStarRocks DatabaseClickHouse DatabaseMySQL DatabasePostgreSQL DatabaseTiDB DatabaseDoris DatabaseMongoDB )
func DatabaseTypeFromString ¶
func DatabaseTypeFromString(s string) DatabaseType
func (DatabaseType) String ¶
func (d DatabaseType) String() string
type DistributionType ¶
type DistributionType int
const ( DistributionUniform DistributionType = iota DistributionNormal DistributionZipfian DistributionExponential )
func (DistributionType) String ¶
func (d DistributionType) String() string
type ErrorCode ¶
type ErrorCode string
ErrorCode defines a typed string for application-specific error codes.
const ( ErrInvalidInput ErrorCode = "invalid_input" ErrParseFailed ErrorCode = "parse_failed" ErrNotFound ErrorCode = "not_found" ErrDatabaseConnection ErrorCode = "database_connection" ErrPluginNotFound ErrorCode = "plugin_not_found" ErrValidationFailed ErrorCode = "validation_failed" ErrExecutionFailed ErrorCode = "execution_failed" ErrReportGeneration ErrorCode = "report_generation" ErrInternal ErrorCode = "internal" )
Defines the set of standard error codes.
type ParameterType ¶
type ParameterType int
const ( TypeInteger ParameterType = iota TypeString TypeFloat TypeBoolean TypeDateTime TypeJSON )
func (ParameterType) String ¶
func (p ParameterType) String() string
type SQLTraceBenchError ¶
SQLTraceBenchError is a custom error type for the application. It includes a machine-readable error code, a human-readable message, and the underlying error that caused it.
func NewError ¶
func NewError(code ErrorCode, message string) *SQLTraceBenchError
NewError creates a new SQLTraceBenchError.
func WrapError ¶
func WrapError(code ErrorCode, message string, cause error) *SQLTraceBenchError
WrapError creates a new SQLTraceBenchError that wraps an existing error.
func (*SQLTraceBenchError) Error ¶
func (e *SQLTraceBenchError) Error() string
Error returns the string representation of the SQLTraceBenchError.