Documentation
¶
Overview ¶
Package config holds the plain-Go application configuration types for run, workload, driver, pool, logger, exporter, and isolation settings. Unmarshal is the shared strict JSON entry point: it preserves established v5 lower-camel and snake_case field names without retaining application schema descriptors.
Regenerate the committed file-envelope schema after changing these types.
Index ¶
- func Unmarshal(data []byte, dst any) error
- type DriverConfig
- func (c *DriverConfig) GetAuthPassword() string
- func (c *DriverConfig) GetAuthToken() string
- func (c *DriverConfig) GetAuthUser() string
- func (c *DriverConfig) GetBulkSize() int32
- func (c *DriverConfig) GetCaCertFile() string
- func (c *DriverConfig) GetDefaultInsertMethod() string
- func (c *DriverConfig) GetServiceAccountKeyFile() string
- func (c *DriverConfig) GetTLSInsecureSkipVerify() bool
- type DriverRunConfig
- func (c *DriverRunConfig) GetAuthPassword() string
- func (c *DriverRunConfig) GetAuthToken() string
- func (c *DriverRunConfig) GetAuthUser() string
- func (c *DriverRunConfig) GetBulkSize() int32
- func (c *DriverRunConfig) GetCaCertFile() string
- func (c *DriverRunConfig) GetDefaultInsertMethod() string
- func (c *DriverRunConfig) GetDriverType() string
- func (c *DriverRunConfig) GetServiceAccountKeyFile() string
- func (c *DriverRunConfig) GetTLSInsecureSkipVerify() bool
- func (c *DriverRunConfig) GetURL() string
- type DriverType
- type ExporterConfig
- type GlobalConfig
- type InsertProgressConfig
- type LogLevel
- type LogMode
- type LoggerConfig
- type OtlpExport
- func (o *OtlpExport) GetOtlpEndpointInsecure() bool
- func (o *OtlpExport) GetOtlpGrpcEndpoint() string
- func (o *OtlpExport) GetOtlpHTTPEndpoint() string
- func (o *OtlpExport) GetOtlpHTTPExporterURLPath() string
- func (o *OtlpExport) GetOtlpHeaders() string
- func (o *OtlpExport) GetOtlpMetricsPrefix() string
- type PoolConfig
- func (c *PoolConfig) GetConnMaxIdleTime() string
- func (c *PoolConfig) GetConnMaxLifetime() string
- func (c *PoolConfig) GetDefaultQueryExecMode() string
- func (c *PoolConfig) GetDescriptionCacheCapacity() int32
- func (c *PoolConfig) GetMaxConnIdleTime() string
- func (c *PoolConfig) GetMaxConnLifetime() string
- func (c *PoolConfig) GetMaxConns() int32
- func (c *PoolConfig) GetMaxIdleConns() int32
- func (c *PoolConfig) GetMaxOpenConns() int32
- func (c *PoolConfig) GetMinConns() int32
- func (c *PoolConfig) GetMinIdleConns() int32
- func (c *PoolConfig) GetStatementCacheCapacity() int32
- func (c *PoolConfig) GetTraceLogLevel() string
- type PostgresConfig
- func (c *PostgresConfig) GetDefaultQueryExecMode() string
- func (c *PostgresConfig) GetDescriptionCacheCapacity() int32
- func (c *PostgresConfig) GetMaxConnIdleTime() string
- func (c *PostgresConfig) GetMaxConnLifetime() string
- func (c *PostgresConfig) GetMaxConns() int32
- func (c *PostgresConfig) GetMinConns() int32
- func (c *PostgresConfig) GetMinIdleConns() int32
- func (c *PostgresConfig) GetStatementCacheCapacity() int32
- func (c *PostgresConfig) GetTraceLogLevel() string
- type RunConfig
- type SQLConfig
- type TxIsolationLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DriverConfig ¶
type DriverConfig struct {
URL string `json:"url,omitempty"`
DriverType DriverType `json:"driverType,omitempty"`
// DefaultInsertMethod is the driver fallback when a workload leaves
// InsertRequest.Method unset.
DefaultInsertMethod string `json:"defaultInsertMethod,omitempty"`
BulkSize *int32 `json:"bulkSize,omitempty"`
Postgres *PostgresConfig `json:"postgres,omitempty"`
SQL *SQLConfig `json:"sql,omitempty"`
CaCertFile *string `json:"caCertFile,omitempty"`
AuthToken *string `json:"authToken,omitempty"`
ServiceAccountKeyFile *string `json:"serviceAccountKeyFile,omitempty"`
AuthUser *string `json:"authUser,omitempty"`
AuthPassword *string `json:"authPassword,omitempty"`
TLSInsecureSkipVerify *bool `json:"tlsInsecureSkipVerify,omitempty"`
InsertProgress *InsertProgressConfig `json:"insertProgress,omitempty"`
Recording *record.Recorder `json:"-"`
}
DriverConfig is the runtime driver configuration consumed by the drivers and bench engine. It is assembled internally, never JSON-decoded directly.
func (*DriverConfig) GetAuthPassword ¶
func (c *DriverConfig) GetAuthPassword() string
func (*DriverConfig) GetAuthToken ¶
func (c *DriverConfig) GetAuthToken() string
func (*DriverConfig) GetAuthUser ¶
func (c *DriverConfig) GetAuthUser() string
func (*DriverConfig) GetBulkSize ¶
func (c *DriverConfig) GetBulkSize() int32
func (*DriverConfig) GetCaCertFile ¶
func (c *DriverConfig) GetCaCertFile() string
func (*DriverConfig) GetDefaultInsertMethod ¶
func (c *DriverConfig) GetDefaultInsertMethod() string
func (*DriverConfig) GetServiceAccountKeyFile ¶
func (c *DriverConfig) GetServiceAccountKeyFile() string
func (*DriverConfig) GetTLSInsecureSkipVerify ¶
func (c *DriverConfig) GetTLSInsecureSkipVerify() bool
type DriverRunConfig ¶
type DriverRunConfig struct {
DriverType *string `json:"driverType,omitempty"`
URL *string `json:"url,omitempty"`
Pool *PoolConfig `json:"pool,omitempty"`
BulkSize *int32 `json:"bulkSize,omitempty"`
CaCertFile *string `json:"caCertFile,omitempty"`
AuthToken *string `json:"authToken,omitempty"`
ServiceAccountKeyFile *string `json:"serviceAccountKeyFile,omitempty"`
AuthUser *string `json:"authUser,omitempty"`
AuthPassword *string `json:"authPassword,omitempty"`
TLSInsecureSkipVerify *bool `json:"tlsInsecureSkipVerify,omitempty"`
DefaultInsertMethod *string `json:"defaultInsertMethod,omitempty"`
Postgres *PostgresConfig `json:"postgres,omitempty"`
SQL *SQLConfig `json:"sql,omitempty"`
InsertProgress *InsertProgressConfig `json:"insertProgress,omitempty"`
}
DriverRunConfig is the user-facing driver configuration for the config file.
func (*DriverRunConfig) GetAuthPassword ¶
func (c *DriverRunConfig) GetAuthPassword() string
func (*DriverRunConfig) GetAuthToken ¶
func (c *DriverRunConfig) GetAuthToken() string
func (*DriverRunConfig) GetAuthUser ¶
func (c *DriverRunConfig) GetAuthUser() string
func (*DriverRunConfig) GetBulkSize ¶
func (c *DriverRunConfig) GetBulkSize() int32
func (*DriverRunConfig) GetCaCertFile ¶
func (c *DriverRunConfig) GetCaCertFile() string
func (*DriverRunConfig) GetDefaultInsertMethod ¶
func (c *DriverRunConfig) GetDefaultInsertMethod() string
func (*DriverRunConfig) GetDriverType ¶
func (c *DriverRunConfig) GetDriverType() string
func (*DriverRunConfig) GetServiceAccountKeyFile ¶
func (c *DriverRunConfig) GetServiceAccountKeyFile() string
func (*DriverRunConfig) GetTLSInsecureSkipVerify ¶
func (c *DriverRunConfig) GetTLSInsecureSkipVerify() bool
func (*DriverRunConfig) GetURL ¶
func (c *DriverRunConfig) GetURL() string
type DriverType ¶
type DriverType int32
DriverType identifies a database driver implementation.
const ( DriverTypeUnspecified DriverType = 0 DriverTypePostgres DriverType = 1 DriverTypeMySQL DriverType = 2 DriverTypePicodata DriverType = 3 DriverTypeYDB DriverType = 4 DriverTypeNoop DriverType = 5 DriverTypeCSV DriverType = 6 DriverTypeRecording DriverType = 7 // Engines that speak another driver's protocol but are their own product: // CockroachDB and YugabyteDB speak the postgres wire, TiDB the mysql one. They // are separate kinds because each selects its own SQL asset and defaults. DriverTypeCRDB DriverType = 8 DriverTypeYugabyte DriverType = 9 DriverTypeTiDB DriverType = 10 )
func DriverTypeValues ¶
func DriverTypeValues() []DriverType
DriverTypeValues returns every concrete driver type in enum order, excluding the unspecified sentinel.
func (DriverType) String ¶
func (d DriverType) String() string
type ExporterConfig ¶
type ExporterConfig struct {
Name string `json:"name,omitempty"`
OtlpExport *OtlpExport `json:"otlpExport,omitempty"`
}
ExporterConfig contains named configuration for an OTLP exporter.
type GlobalConfig ¶
type GlobalConfig struct {
Version string `json:"version,omitempty"`
RunID string `json:"runId,omitempty"`
Seed uint64 `json:"seed,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Logger *LoggerConfig `json:"logger,omitempty"`
Exporter *ExporterConfig `json:"exporter,omitempty"`
}
GlobalConfig holds global stroppy settings: logger, exporter, seed, run_id, and metadata.
type InsertProgressConfig ¶
type InsertProgressConfig struct {
Enabled *bool `json:"enabled,omitempty"`
Interval *string `json:"interval,omitempty"`
StallAfter *string `json:"stallAfter,omitempty"`
Mode *string `json:"mode,omitempty"`
}
InsertProgressConfig is periodic typed-load progress reporting.
func (*InsertProgressConfig) GetEnabled ¶
func (c *InsertProgressConfig) GetEnabled() bool
func (*InsertProgressConfig) GetInterval ¶
func (c *InsertProgressConfig) GetInterval() string
func (*InsertProgressConfig) GetMode ¶
func (c *InsertProgressConfig) GetMode() string
func (*InsertProgressConfig) GetStallAfter ¶
func (c *InsertProgressConfig) GetStallAfter() string
type LogLevel ¶
type LogLevel int32
LogLevel is the minimum log level to output.
func LogLevelValues ¶
func LogLevelValues() []LogLevel
LogLevelValues returns every declared LogLevel constant in canonical order.
func ParseLogLevel ¶
ParseLogLevel accepts the short and v5 logging level names, or a valid ordinal.
func (LogLevel) MarshalJSON ¶
func (*LogLevel) UnmarshalJSON ¶
type LogMode ¶
type LogMode int32
LogMode is the logging output mode.
func LogModeValues ¶
func LogModeValues() []LogMode
LogModeValues returns every declared LogMode constant in canonical order.
func ParseLogMode ¶
func (LogMode) MarshalJSON ¶
func (*LogMode) UnmarshalJSON ¶
type LoggerConfig ¶
type LoggerConfig struct {
LogLevel LogLevel `json:"logLevel,omitempty"`
LogMode LogMode `json:"logMode,omitempty"`
}
LoggerConfig controls log levels and output formatting.
type OtlpExport ¶
type OtlpExport struct {
OtlpGrpcEndpoint *string `json:"otlpGrpcEndpoint,omitempty"`
OtlpHTTPEndpoint *string `json:"otlpHttpEndpoint,omitempty"`
OtlpHTTPExporterURLPath *string `json:"otlpHttpExporterUrlPath,omitempty"`
OtlpEndpointInsecure *bool `json:"otlpEndpointInsecure,omitempty"`
OtlpHeaders *string `json:"otlpHeaders,omitempty"`
OtlpMetricsPrefix *string `json:"otlpMetricsPrefix,omitempty"`
}
OtlpExport contains configuration for exporting metrics via OTLP.
func (*OtlpExport) GetOtlpEndpointInsecure ¶
func (o *OtlpExport) GetOtlpEndpointInsecure() bool
func (*OtlpExport) GetOtlpGrpcEndpoint ¶
func (o *OtlpExport) GetOtlpGrpcEndpoint() string
func (*OtlpExport) GetOtlpHTTPEndpoint ¶
func (o *OtlpExport) GetOtlpHTTPEndpoint() string
func (*OtlpExport) GetOtlpHTTPExporterURLPath ¶
func (o *OtlpExport) GetOtlpHTTPExporterURLPath() string
func (*OtlpExport) GetOtlpHeaders ¶
func (o *OtlpExport) GetOtlpHeaders() string
func (*OtlpExport) GetOtlpMetricsPrefix ¶
func (o *OtlpExport) GetOtlpMetricsPrefix() string
type PoolConfig ¶
type PoolConfig struct {
MaxConns *int32 `json:"maxConns,omitempty"`
MinConns *int32 `json:"minConns,omitempty"`
MinIdleConns *int32 `json:"minIdleConns,omitempty"`
MaxConnLifetime *string `json:"maxConnLifetime,omitempty"`
MaxConnIdleTime *string `json:"maxConnIdleTime,omitempty"`
TraceLogLevel *string `json:"traceLogLevel,omitempty"`
DefaultQueryExecMode *string `json:"defaultQueryExecMode,omitempty"`
DescriptionCacheCapacity *int32 `json:"descriptionCacheCapacity,omitempty"`
StatementCacheCapacity *int32 `json:"statementCacheCapacity,omitempty"`
MaxOpenConns *int32 `json:"maxOpenConns,omitempty"`
MaxIdleConns *int32 `json:"maxIdleConns,omitempty"`
ConnMaxLifetime *string `json:"connMaxLifetime,omitempty"`
ConnMaxIdleTime *string `json:"connMaxIdleTime,omitempty"`
}
PoolConfig is a sugar pool block accepted on the config-file driver. It maps to PostgresConfig or SQLConfig based on driver type.
func (*PoolConfig) GetConnMaxIdleTime ¶
func (c *PoolConfig) GetConnMaxIdleTime() string
func (*PoolConfig) GetConnMaxLifetime ¶
func (c *PoolConfig) GetConnMaxLifetime() string
func (*PoolConfig) GetDefaultQueryExecMode ¶
func (c *PoolConfig) GetDefaultQueryExecMode() string
func (*PoolConfig) GetDescriptionCacheCapacity ¶
func (c *PoolConfig) GetDescriptionCacheCapacity() int32
func (*PoolConfig) GetMaxConnIdleTime ¶
func (c *PoolConfig) GetMaxConnIdleTime() string
func (*PoolConfig) GetMaxConnLifetime ¶
func (c *PoolConfig) GetMaxConnLifetime() string
func (*PoolConfig) GetMaxConns ¶
func (c *PoolConfig) GetMaxConns() int32
func (*PoolConfig) GetMaxIdleConns ¶
func (c *PoolConfig) GetMaxIdleConns() int32
func (*PoolConfig) GetMaxOpenConns ¶
func (c *PoolConfig) GetMaxOpenConns() int32
func (*PoolConfig) GetMinConns ¶
func (c *PoolConfig) GetMinConns() int32
func (*PoolConfig) GetMinIdleConns ¶
func (c *PoolConfig) GetMinIdleConns() int32
func (*PoolConfig) GetStatementCacheCapacity ¶
func (c *PoolConfig) GetStatementCacheCapacity() int32
func (*PoolConfig) GetTraceLogLevel ¶
func (c *PoolConfig) GetTraceLogLevel() string
type PostgresConfig ¶
type PostgresConfig struct {
TraceLogLevel *string `json:"traceLogLevel,omitempty"`
MaxConnLifetime *string `json:"maxConnLifetime,omitempty"`
MaxConnIdleTime *string `json:"maxConnIdleTime,omitempty"`
MaxConns *int32 `json:"maxConns,omitempty"`
MinConns *int32 `json:"minConns,omitempty"`
MinIdleConns *int32 `json:"minIdleConns,omitempty"`
DefaultQueryExecMode *string `json:"defaultQueryExecMode,omitempty"`
DescriptionCacheCapacity *int32 `json:"descriptionCacheCapacity,omitempty"`
StatementCacheCapacity *int32 `json:"statementCacheCapacity,omitempty"`
}
PostgresConfig is PostgreSQL-specific pool and connection configuration.
func (*PostgresConfig) GetDefaultQueryExecMode ¶
func (c *PostgresConfig) GetDefaultQueryExecMode() string
func (*PostgresConfig) GetDescriptionCacheCapacity ¶
func (c *PostgresConfig) GetDescriptionCacheCapacity() int32
func (*PostgresConfig) GetMaxConnIdleTime ¶
func (c *PostgresConfig) GetMaxConnIdleTime() string
func (*PostgresConfig) GetMaxConnLifetime ¶
func (c *PostgresConfig) GetMaxConnLifetime() string
func (*PostgresConfig) GetMaxConns ¶
func (c *PostgresConfig) GetMaxConns() int32
func (*PostgresConfig) GetMinConns ¶
func (c *PostgresConfig) GetMinConns() int32
func (*PostgresConfig) GetMinIdleConns ¶
func (c *PostgresConfig) GetMinIdleConns() int32
func (*PostgresConfig) GetStatementCacheCapacity ¶
func (c *PostgresConfig) GetStatementCacheCapacity() int32
func (*PostgresConfig) GetTraceLogLevel ¶
func (c *PostgresConfig) GetTraceLogLevel() string
type RunConfig ¶
type RunConfig struct {
Version string `json:"version,omitempty"`
Script *string `json:"script,omitempty"`
SQL *string `json:"sql,omitempty"`
Global *GlobalConfig `json:"global,omitempty"`
Drivers map[string]*DriverRunConfig `json:"drivers,omitempty"`
Run map[string]json.RawMessage `configscope:"run" json:"run,omitempty"`
Params map[string]json.RawMessage `configscope:"params" json:"params,omitempty"`
Steps []string `json:"steps,omitempty"`
NoSteps []string `json:"noSteps,omitempty"`
}
RunConfig is the top-level stroppy config file schema.
type SQLConfig ¶
type SQLConfig struct {
MaxOpenConns *int32 `json:"maxOpenConns,omitempty"`
MaxIdleConns *int32 `json:"maxIdleConns,omitempty"`
ConnMaxLifetime *string `json:"connMaxLifetime,omitempty"`
ConnMaxIdleTime *string `json:"connMaxIdleTime,omitempty"`
}
SQLConfig is generic database/sql pool settings for SQL-based drivers.
func (*SQLConfig) GetConnMaxIdleTime ¶
func (*SQLConfig) GetConnMaxLifetime ¶
func (*SQLConfig) GetMaxIdleConns ¶
func (*SQLConfig) GetMaxOpenConns ¶
type TxIsolationLevel ¶
type TxIsolationLevel int32
TxIsolationLevel is the isolation level of a database transaction.
const ( TxIsolationLevelUnspecified TxIsolationLevel = 0 TxIsolationLevelReadUncommitted TxIsolationLevel = 1 TxIsolationLevelReadCommitted TxIsolationLevel = 2 TxIsolationLevelRepeatableRead TxIsolationLevel = 3 TxIsolationLevelSerializable TxIsolationLevel = 4 TxIsolationLevelConnectionOnly TxIsolationLevel = 5 TxIsolationLevelNone TxIsolationLevel = 6 )