Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultBatchSize = 100 DefaultFlushInterval = time.Minute DefaultTableName = "results" DefaultDatabaseName = "httpx" EnvConnectionString = "HTTPX_DB_CONNECTION_STRING" )
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(dbType DatabaseType, factory databaseFactory)
Types ¶
type Config ¶
type Config struct {
Type DatabaseType `yaml:"type"`
ConnectionString string `yaml:"connection-string"`
DatabaseName string `yaml:"database-name"`
TableName string `yaml:"table-name"`
BatchSize int `yaml:"batch-size"`
FlushInterval time.Duration `yaml:"flush-interval"`
OmitRaw bool `yaml:"omit-raw"`
}
func LoadConfigFromFile ¶
func (*Config) ApplyDefaults ¶
func (c *Config) ApplyDefaults()
type Database ¶
type Database interface {
Connect(ctx context.Context) error
Close() error
InsertBatch(ctx context.Context, results []runner.Result) error
EnsureSchema(ctx context.Context) error
Type() DatabaseType
}
func NewDatabase ¶
type DatabaseType ¶
type DatabaseType string
const ( MongoDB DatabaseType = "mongodb" PostgreSQL DatabaseType = "postgres" MySQL DatabaseType = "mysql" )
func SupportedDatabases ¶
func SupportedDatabases() []DatabaseType
func (DatabaseType) IsValid ¶
func (d DatabaseType) IsValid() bool
func (DatabaseType) String ¶
func (d DatabaseType) String() string
type Options ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) GetWriterCallback ¶
func (w *Writer) GetWriterCallback() runner.OnResultCallback
Click to show internal directories.
Click to hide internal directories.