Documentation
¶
Index ¶
- type ElasticsearchConnector
- type KafkaConnector
- type NewElasticsearchConnectorArgs
- type NewKafkaConnectorArgs
- type NewPostgresConnectorArgs
- type NewRedisConnectorArgs
- type PostgresConnector
- type RedisConnector
- func (r *RedisConnector) Del(ctx context.Context, keys ...string) error
- func (r *RedisConnector) Get(ctx context.Context, key string) (string, error)
- func (r *RedisConnector) Healthcheck() error
- func (r *RedisConnector) LLen(ctx context.Context, key string) (int64, error)
- func (r *RedisConnector) LRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (r *RedisConnector) Set(ctx context.Context, key string, value any, expiration time.Duration) error
- func (r *RedisConnector) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ElasticsearchConnector ¶
type ElasticsearchConnector struct {
// contains filtered or unexported fields
}
func NewElasticsearchConnector ¶
func NewElasticsearchConnector(ctx context.Context, args *NewElasticsearchConnectorArgs, ) *ElasticsearchConnector
func (*ElasticsearchConnector) GetClient ¶
func (e *ElasticsearchConnector) GetClient() *elasticsearch.Client
func (*ElasticsearchConnector) Healthcheck ¶
func (e *ElasticsearchConnector) Healthcheck() error
func (*ElasticsearchConnector) Shutdown ¶
func (e *ElasticsearchConnector) Shutdown()
The Elasticsearch Go client is stateless by nature, hence why, we don't need to do anything. Still, if you want, you can use your own HTTP transport while constructing the Elasticseach client, and then close the HTTP transport's idle connections in Shutdown( ). REFERENCE : https://discuss.elastic.co/t/how-to-close-the-connection-using-go-client/350123.
type KafkaConnector ¶
type KafkaConnector struct {
// contains filtered or unexported fields
}
func NewKafkaConnector ¶
func NewKafkaConnector(ctx context.Context, args *NewKafkaConnectorArgs) *KafkaConnector
func (*KafkaConnector) GetClient ¶
func (k *KafkaConnector) GetClient() *kgo.Client
func (*KafkaConnector) Healthcheck ¶
func (k *KafkaConnector) Healthcheck() error
func (*KafkaConnector) Shutdown ¶
func (k *KafkaConnector) Shutdown()
type NewKafkaConnectorArgs ¶
type NewPostgresConnectorArgs ¶
type NewPostgresConnectorArgs struct {
URL string `yaml:"url" validate:"required,notblank"`
}
type NewRedisConnectorArgs ¶
type PostgresConnector ¶
type PostgresConnector struct {
// contains filtered or unexported fields
}
func NewPostgresConnector ¶
func NewPostgresConnector(ctx context.Context, args *NewPostgresConnectorArgs) *PostgresConnector
func (*PostgresConnector) GetConnection ¶
func (p *PostgresConnector) GetConnection() *sql.DB
func (*PostgresConnector) Healthcheck ¶
func (p *PostgresConnector) Healthcheck() error
func (*PostgresConnector) Shutdown ¶
func (p *PostgresConnector) Shutdown()
type RedisConnector ¶
type RedisConnector struct {
// contains filtered or unexported fields
}
func NewRedisConnector ¶
func NewRedisConnector(ctx context.Context, args *NewRedisConnectorArgs) *RedisConnector
func (*RedisConnector) Del ¶
func (r *RedisConnector) Del(ctx context.Context, keys ...string) error
func (*RedisConnector) Healthcheck ¶
func (r *RedisConnector) Healthcheck() error
func (*RedisConnector) Shutdown ¶
func (r *RedisConnector) Shutdown()
Click to show internal directories.
Click to hide internal directories.