Versions in this module Expand all Collapse all v1 v1.1.0 Dec 29, 2023 Changes in this version + const ClickHouse + type ClickHouseConfig struct + ConnRetryDuration int + Database string + Host string + MaxConnLife int + MaxIdleConn int + MaxOpenConn int + Password string + Port string + Username string + type ClickHouseDB struct + func GetNewClickHouseDB(logger log.Logger, config *ClickHouseConfig) (ClickHouseDB, error) + func (c *ClickHouseDB) Exec(ctx context.Context, query string, args ...interface{}) error + func (c *ClickHouseDB) Query(ctx context.Context, query string, args ...interface{}) (driver.Rows, error) + func (c *ClickHouseDB) QueryRow(ctx context.Context, query string, args ...interface{}) driver.Row + func (c ClickHouseDB) HealthCheck() types.Health type DataStore + ClickHouse ClickHouseDB + func (ds *DataStore) ClickHouseHealthCheck() types.Health v1.0.3 Dec 14, 2023 v1.0.2 Nov 29, 2023 v1.0.1 Nov 23, 2023 Changes in this version + const DynamoStore + const SQLStore v1.0.0 Oct 24, 2023 Changes in this version + const AWSSNS + const Avro + const CassandraStore + const DynamoDb + const ElasticSearch + const EventBridge + const EventHub + const GooglePubSub + const Kafka + const MongoStore + const RedisStore + const SqlStore + const Ycql + func NewMySQLDialector(cfg *DBConfig, connectionStr, driverName string) (gorm.Dialector, error) + type Cassandra struct + Cluster *gocql.ClusterConfig + Session *gocql.Session + func GetNewCassandra(logger log.Logger, cassandraCfg *CassandraCfg) (Cassandra, error) + func (c *Cassandra) HealthCheck() types.Health + type CassandraCfg struct + CertificateFile string + ConnRetryDuration int + ConnectTimeout int + Consistency string + DataCenter string + HostVerification bool + Hosts string + InsecureSkipVerify bool + KeyFile string + Keyspace string + Password string + Port int + RetryPolicy gocql.RetryPolicy + RootCertificateFile string + TLSVersion uint16 + Timeout int + Username string + type Client struct + func NewSolrClient(host, port string) Client + func (c Client) AddField(ctx context.Context, collection string, document *bytes.Buffer) (interface{}, error) + func (c Client) Create(ctx context.Context, collection string, document *bytes.Buffer, ...) (interface{}, error) + func (c Client) Delete(ctx context.Context, collection string, document *bytes.Buffer, ...) (interface{}, error) + func (c Client) DeleteField(ctx context.Context, collection string, document *bytes.Buffer) (interface{}, error) + func (c Client) ListFields(ctx context.Context, collection string, params map[string]interface{}) (interface{}, error) + func (c Client) Retrieve(ctx context.Context, collection string, params map[string]interface{}) (interface{}, error) + func (c Client) Search(ctx context.Context, collection string, params map[string]interface{}) (interface{}, error) + func (c Client) Update(ctx context.Context, collection string, document *bytes.Buffer, ...) (interface{}, error) + func (c Client) UpdateField(ctx context.Context, collection string, document *bytes.Buffer) (interface{}, error) + type DBConfig struct + CACertificateFile string + CertificateFile string + ConnRetryDuration int + Database string + Dialect string + HostName string + KeyFile string + MaxConnLife int + MaxIdleConn int + MaxOpenConn int + ORM string + Password string + Port string + SSL string + Username string + type DataStore struct + Cassandra Cassandra + DynamoDB DynamoDB + Elasticsearch Elasticsearch + Logger log.Logger + MongoDB MongoDB + ORM interface{} + PubSub pubsub.PublisherSubscriber + Redis Redis + Solr Client + YCQL YCQL + func (ds *DataStore) CQLHealthCheck() types.Health + func (ds *DataStore) DB() *SQLClient + func (ds *DataStore) DynamoDBHealthCheck() types.Health + func (ds *DataStore) ElasticsearchHealthCheck() types.Health + func (ds *DataStore) GORM() *gorm.DB + func (ds *DataStore) MongoHealthCheck() types.Health + func (ds *DataStore) PubSubHealthCheck() types.Health + func (ds *DataStore) RedisHealthCheck() types.Health + func (ds *DataStore) SQLHealthCheck() types.Health + func (ds *DataStore) SQLX() *sqlx.DB + func (ds *DataStore) SQLXHealthCheck() types.Health + func (ds *DataStore) SetORM(client interface{}) + func (ds *DataStore) YCQLHealthCheck() types.Health + type Document interface + Create func(ctx context.Context, collection string, document *bytes.Buffer, ...) (interface{}, error) + Delete func(ctx context.Context, collection string, document *bytes.Buffer, ...) (interface{}, error) + Search func(ctx context.Context, collection string, params map[string]interface{}) (interface{}, error) + Update func(ctx context.Context, collection string, document *bytes.Buffer, ...) (interface{}, error) + type DynamoDB struct + func NewDynamoDB(logger log.Logger, c DynamoDBConfig) (DynamoDB, error) + func (d *DynamoDB) DeleteItem(input *dynamodb.DeleteItemInput) (*dynamodb.DeleteItemOutput, error) + func (d *DynamoDB) DeleteItemRequest(input *dynamodb.DeleteItemInput) (*Request, *dynamodb.DeleteItemOutput) + func (d *DynamoDB) DeleteItemWithContext(ctx context.Context, input *dynamodb.DeleteItemInput) (*dynamodb.DeleteItemOutput, error) + func (d *DynamoDB) GetItem(input *dynamodb.GetItemInput) (*dynamodb.GetItemOutput, error) + func (d *DynamoDB) GetItemRequest(input *dynamodb.GetItemInput) (*Request, *dynamodb.GetItemOutput) + func (d *DynamoDB) GetItemWithContext(ctx context.Context, input *dynamodb.GetItemInput) (*dynamodb.GetItemOutput, error) + func (d *DynamoDB) HealthCheck() types.Health + func (d *DynamoDB) PutItem(input *dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error) + func (d *DynamoDB) PutItemRequest(input *dynamodb.PutItemInput) (*Request, *dynamodb.PutItemOutput) + func (d *DynamoDB) PutItemWithContext(ctx context.Context, input *dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error) + func (d *DynamoDB) UpdateItem(input *dynamodb.UpdateItemInput) (*dynamodb.UpdateItemOutput, error) + func (d *DynamoDB) UpdateItemRequest(input *dynamodb.UpdateItemInput) (*Request, *dynamodb.UpdateItemOutput) + func (d *DynamoDB) UpdateItemWithContext(ctx context.Context, input *dynamodb.UpdateItemInput) (*dynamodb.UpdateItemOutput, error) + type DynamoDBConfig struct + AccessKeyID string + ConnRetryDuration int + Endpoint string + Region string + SecretAccessKey string + type ElasticSearchCfg struct + CloudID string + ConnectionRetryDuration int + Host string + Password string + Ports []int + Username string + type Elasticsearch struct + func NewElasticsearchClient(logger log.Logger, c *ElasticSearchCfg) (Elasticsearch, error) + func (e *Elasticsearch) Bind(res *esapi.Response, target interface{}) error + func (e *Elasticsearch) BindArray(res *esapi.Response, target interface{}) error + func (e *Elasticsearch) Body(res *esapi.Response) (map[string]interface{}, error) + func (e *Elasticsearch) HealthCheck() types.Health + func (e *Elasticsearch) Hits(res *esapi.Response) ([]interface{}, error) + func (e *Elasticsearch) Ping() (*esapi.Response, error) + type GORMClient struct + func NewORM(cfg *DBConfig) (GORMClient, error) + func NewORMFromEnv() (GORMClient, error) + func (c GORMClient) HealthCheck() types.Health + type MongoConfig struct + ConnRetryDuration int + Database string + HostName string + Password string + Port string + RetryWrites bool + SSL bool + Username string + type MongoDB interface + Aggregate func(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error) + Collection func(name string, opts ...*options.CollectionOptions) *mongo.Collection + HealthCheck func() types.Health + IsSet func() bool + RunCommand func(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) *mongo.SingleResult + RunCommandCursor func(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (*mongo.Cursor, error) + func GetMongoDBFromEnv(logger log.Logger) (MongoDB, error) + func GetNewMongoDB(logger log.Logger, config *MongoConfig) (MongoDB, error) + type QueryLogger struct + DataStore string + Duration int64 + Hosts string + Logger log.Logger + Query []string + StartTime time.Time + func (l *QueryLogger) AfterProcess(_ context.Context, cmd goRedis.Cmder) error + func (l *QueryLogger) AfterProcessPipeline(_ context.Context, cmds []goRedis.Cmder) error + func (l *QueryLogger) BeforeProcess(ctx context.Context, _ goRedis.Cmder) (context.Context, error) + func (l *QueryLogger) BeforeProcessPipeline(ctx context.Context, _ []goRedis.Cmder) (context.Context, error) + func (l *QueryLogger) String() string + func (l QueryLogger) ObserveBatch(_ context.Context, b gocql.ObservedBatch) + func (l QueryLogger) ObserveQuery(_ context.Context, o gocql.ObservedQuery) + type Redis interface + HealthCheck func() types.Health + IsSet func() bool + func NewRedis(logger log.Logger, config RedisConfig) (Redis, error) + func NewRedisCluster(clusterOptions *goRedis.ClusterOptions) (Redis, error) + func NewRedisFromEnv(options *goRedis.Options) (Redis, error) + type RedisConfig struct + ConnectionRetryDuration int + DB int + HostName string + Options *goRedis.Options + Password string + Port string + SSL bool + type Request struct + func (r *Request) Send() error + type Response struct + Code int + Data interface{} + type SQLClient struct + func (c *SQLClient) Begin() (*SQLTx, error) + func (c *SQLClient) BeginTx(ctx context.Context, opts *sql.TxOptions) (*SQLTx, error) + func (c *SQLClient) Exec(query string, args ...interface{}) (sql.Result, error) + func (c *SQLClient) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + func (c *SQLClient) Query(query string, args ...interface{}) (*sql.Rows, error) + func (c *SQLClient) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + func (c *SQLClient) QueryRow(query string, args ...interface{}) *sql.Row + func (c *SQLClient) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + type SQLTx struct + func (c *SQLTx) Commit() error + func (c *SQLTx) Exec(query string, args ...interface{}) (sql.Result, error) + func (c *SQLTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + func (c *SQLTx) Query(query string, args ...interface{}) (*sql.Rows, error) + func (c *SQLTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + func (c *SQLTx) QueryRow(query string, args ...interface{}) *sql.Row + func (c *SQLTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + type SQLXClient struct + func NewSQLX(cfg *DBConfig) (SQLXClient, error) + func (c SQLXClient) HealthCheck() types.Health + type Schema interface + AddField func(ctx context.Context, collection string, document *bytes.Buffer) (interface{}, error) + DeleteField func(ctx context.Context, collection string, document *bytes.Buffer) (interface{}, error) + ListFields func(ctx context.Context, collection string, params map[string]interface{}) (interface{}, error) + Retrieve func(ctx context.Context, collection string, params map[string]interface{}) (interface{}, error) + UpdateField func(ctx context.Context, collection string, document *bytes.Buffer) (interface{}, error) + type Seeder struct + ResetCounter bool + func NewSeeder(db *DataStore, directoryPath string) *Seeder + func (d *Seeder) AssertRowCount(t tester, tableName string, count int) + func (d *Seeder) AssertVersion(t tester, version string) + func (d *Seeder) ClearTable(t tester, tableName string) + func (d *Seeder) RefreshCassandra(t tester, tableNames ...string) + func (d *Seeder) RefreshDynamoDB(t tester, tableNames ...string) + func (d *Seeder) RefreshElasticSearch(t tester, indexes ...string) + func (d *Seeder) RefreshMongoCollections(t tester, collectionNames ...string) + func (d *Seeder) RefreshRedis(t tester, tableNames ...string) + func (d *Seeder) RefreshTables(t tester, tableNames ...string) + func (d *Seeder) RefreshYCQL(t tester, tableNames ...string) + type YCQL struct + Cluster *gocql.ClusterConfig + Session *gocql.Session + func GetNewYCQL(logger log.Logger, config *CassandraCfg) (YCQL, error) + func (y *YCQL) HealthCheck() types.Health